Yesterday Jeremy Ashkenas came by Gilt to talk about CoffeeScript, a language he’s been working on since 2009. CoffeeScript is a simple language with syntactic roots in Python and Ruby. It compiles into JavaScript and adds interesting features including array comprehensions. CoffeeScript is arguably more readable than JavaScript.
Jeremy gave a great overview of CoffeeScript and who is using it. He gets into detail on the Syntax of the language and also discusses its implementation and how to go about creating your own language.
Here’s a method I haven’t seen before: attr_accessor_with_default
This ActiveSupport method allows you to set a default value for an attribute accessor:
class Person attr_accessor_with_default :age, 25 end some_person.age # => 25 some_person.age = 26 some_person.age # => 26You can even pass in a block.
(Source: rubydoc.info)
19 notes (via rubyquicktips & rubyflare)
Long, but looks like it contains some good nuggets.
Robby Russell’s zsh framework indeed made us say oh-my-zsh!. With over forty themes and a dozen plugins, oh-my-zsh makes it easy to pimp your zsh.
If you’re perfectly happy with bash and things like right side prompts, smart tab completions, and shared session history aren’t your bag, then check out bash-it from Robert Evans. Like oh-my-zsh, bash-it provides a community framework for pimping your shell using themes and plugins.
To install, clone the repo:
git clone http://github.com/revans/bash-it.gitBe sure and backup your current
.bash_profile:cp ~/.bash_profile ~/.bash_profile.bak… and then start with bash-it’s default profile template.
cp <path/to/cloned/repo>/template/bash_profile.template.bash ~/.bash_profileCurrent plugins provide extra goodies for git, rails, and common aliases. Mercurial support is on the way. Got ideas? Well get to forkin’ and send a pull request already.
46 notes (via thechangelog)
For those times you need to quickly browse a GitHub repo but don’t want to clone it locally, check out GitHubFinder from Alex Le.
Modeled after the Mac OSX finder, GitHubFinder provides a familiar drill-down navigation to browse all the files in a given repo. The project has a plugin-based architecture for extensibility and includes keyboard navigation, file diffs, basic syntax highlighting, and a resizable, panel-based interface out of the box.
Written in JavaScript as part of the 10K Apart Contest, the app uses the same JSONP API we use here on The Changelog and weighs in at just 8.5KB compressed. Bravo, Alex! [Source on GitHub]
This is hot.
10 notes (via thechangelog)
Facebook loves iOS developers. First, they gave us Three20, a nice iOS app framework extracted from their popular native app. Now they’ve released the Facebook iOS SDK which lets you easily add authorization, API calls, and Facebook dialogs to your iOS apps.
Authorization
To authorize a user using OAuth2 you can simply create the Facebook client and call
authorizefacebook = [[Facebook alloc] init]; [facebook authorize:apiKey permissions:permissions delegate:self];Making API calls
Now you can do things like getting info for the authenticating user:
[facebook requestWithGraphPath:@"me" andDelegate:self];or get that users’s friends
[facebook requestWithGraphPath:@"me/friends" andDelegate:self];
41 notes (via thechangelog)
Well as some of you have noticed, things have been a bit quiet around here this week.
Fear not, we’re not about to stop covering the fast-moving world of open source. We’ve just been working to give The Changelog a fresh coat of paint.
We love Tumblr, but creating custom themes isn’t the…
Fumblr looks fantastic. Can’t believe I didn’t look for something like this the other day when I was fighting with a theme.
13 notes (via thechangelog)