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
| # List of conferences | |
| curl -d {} -H "Content-Type:application/json" https://eventboard.falafel.com/ConferenceService2/ConferenceListEx | |
| # The 59 specifies the version according to the latest version that is present in the DataVersion attribute of the conference list above | |
| curl http://cdn.eventboard.falafel.com/conferencecatalogs/codemash2014.59.data.json |
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 method_missing(method, *args, &block) | |
| if helper.respond_to?(method) | |
| self.class_eval "def #{method}(*args, &block); helper.send('#{method}', *args, &block); end" | |
| self.send(method, *args, &block) | |
| else | |
| super | |
| end | |
| 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
| Design Patterns often are discussed with a negative tone. We laugh at Java developers and their heavy classes with the patterns encoded in the name. After all, who wants to try to understand the AbstractBaseClassFactoryManager? But don't most Ruby developers spend their time in a framework that glorifies a select few patterns to the point where the idea of writing code outside these patterns is considered heretical? On the other hand, Evolutionary Design says we are supposed to let the design come out over time, listening to the feedback we get from the combination of tests and refactoring, planning as little ahead as possible. What's a developer to do? | |
| Ideally, Design Patterns are used as communication, not construction, as description, not prescription. In this talk, we'll discuss using patterns as a goal, as guides when iterating and evolving our system's design. Rather than thinking "I'll solve this with a strategy pattern," we can say that our design is heading "towards a strategy pattern" or we ended u |
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
| 🐈 $ baseline up ruby | |
| /Users/coreyhaines/Documents/codes/test/.baseline/Vagrantfile:14:in `<top (required)>': undefined method `configure' for Vagrant:Module (NoMethodError) | |
| from /Users/coreyhaines/.rvm/gems/ruby-2.0.0-p247/gems/vagrant-1.0.7/lib/vagrant/config/loader.rb:115:in `load' | |
| from /Users/coreyhaines/.rvm/gems/ruby-2.0.0-p247/gems/vagrant-1.0.7/lib/vagrant/config/loader.rb:115:in `block in procs_for_source' | |
| from /Users/coreyhaines/.rvm/gems/ruby-2.0.0-p247/gems/vagrant-1.0.7/lib/vagrant/config.rb:41:in `block in capture_configures' | |
| from /Users/coreyhaines/.rvm/gems/ruby-2.0.0-p247/gems/vagrant-1.0.7/lib/vagrant/config.rb:36:in `synchronize' | |
| from /Users/coreyhaines/.rvm/gems/ruby-2.0.0-p247/gems/vagrant-1.0.7/lib/vagrant/config.rb:36:in `capture_configures' | |
| from /Users/coreyhaines/.rvm/gems/ruby-2.0.0-p247/gems/vagrant-1.0.7/lib/vagrant/config/loader.rb:114:in `procs_for_source' | |
| from /Users/coreyhaines/.rvm/gems/ruby-2.0.0-p247/gems/vagrant-1.0.7/lib/vagrant/config/loader.rb:51:in `block in set' |
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
| Chrome | |
| Alfred | |
| Dropbox | |
| 1Password | |
| Sizeup | |
| Coconut Battery | |
| Dash | |
| XCode | |
| Caffeine |
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 Array | |
| def except(*e) | |
| self - e | |
| end | |
| end | |
| # >> [1, 2, 3].except 2 | |
| # => [1, 3] | |
| # >> [1, 2, 3].except 3 | |
| # => [1, 2] |
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
| ruby dots.rb 2> dups.log |
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 EmailJob | |
| include SuckerPunch::Job | |
| def perform(user_id) | |
| UserMailer.welcome(user_id).deliver | |
| end | |
| end | |
| module SuckerPunch | |
| module Job |
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
| {cortex,{cortex,7.293444414396203e-11}, | |
| [{sensor,7.293444414396207e-11}], | |
| [{actuator,7.293444414396204e-11}], | |
| [{neuron,{1,7.293444414396202e-11}}, | |
| {neuron,{2,7.293444414396202e-11}}, | |
| {neuron,{2,7.293444414396202e-11}}, | |
| {neuron,{2,7.2934444143962e-11}}, | |
| {neuron,{3,7.293444414396198e-11}}, | |
| {neuron,{3,7.293444414396196e-11}}, | |
| {neuron,{4,7.29344441439619e-11}}]}. |
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
| // This allows me to replace something like the following (common in initializers) | |
| if(obj) { | |
| //do something, perhaps set up the object with a bunch of properties | |
| } | |
| return obj; | |
| // with doing this | |
| return [obj tap:^(id obj) { | |
| // do something, perhaps set up the object with a bunch of properties | |
| // Bonus: you don't have to check for nil, as this block won't get call if obj is nil. |