This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def toCamelCase(String string) { | |
String result = "" | |
string.findAll("[^\\W]+") { String word -> | |
result += word.capitalize() | |
} | |
return result | |
} | |
afterEvaluate { project -> | |
Configuration runtimeConfiguration = project.configurations.getByName('compile') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Foo | |
def self.foo | |
"foo" | |
end | |
def foo | |
"ifoo" | |
end | |
def true_foo | |
Foo.foo | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[rubyist learn:@"Cocoa" withLanguage:@"MacRuby"]; | |
------------------------------------------------- | |
Cocoa is a fantastic set of libraries to work with, but Objective-C can be a bit of a verbose beast. MacRuby offers Rubyists a great way to use the whole framework, but with a beautiful, developer friendly language. | |
The only catch is that idiomatic Cocoa is kind of weird for a Rubyist. What's a delegate? Aren't we not supposed to use threads in Ruby? It gets even dicier if one decides to write a GUI application, since most of us are writing web apps and don't encounter the concept of a run loop and don't worry about blocking the main thread for users typically. Why is this API so ugly? The unfamiliarity with the assumptions and idioms underlying MacRuby can make it just as hard (or harder!) to pick up. | |
This talk is a solution for the confusion. We'll take 6 core Cocoa concepts and look at what they are, how they're used in Cocoa, and use MacRuby to show their usage. We'll look at: | |
* Syntax (patter |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Threading; | |
using System.Threading.Tasks; | |
namespace SleepSort | |
{ | |
class Program | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Install Postgres 9.1, PostGIS and create PostGIS template on a clean Ubuntu 11.10 Oneiric Ocelot box | |
# http://wildfish.com | |
# add the ubuntu gis ppa | |
sudo apt-get -y install python-software-properties | |
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable | |
sudo apt-get update |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ irb | |
>> require 'active_support/core_ext/numeric/time' | |
=> true | |
>> 1.hour.ago | |
NoMethodError: undefined method `current' for Time:Class | |
from /Users/rando/.rvm/gems/ree-1.8.7-2011.03@core/gems/activesupport-3.0.5/lib/active_support/duration.rb:68:in `ago' | |
from (irb):2 | |
>> require 'active_support/core_ext/time/calculations' | |
=> true | |
>> 1.hour.ago |