- Jim Weirich: The Building Blocks of Modularity – http://goo.gl/g4Nk
- Jim Weirich: SOLID Ruby – http://goo.gl/z3jd
- Sandi Metz: SOLID Object-Oriented Design – http://goo.gl/PDn6T
- Sandi Metz: Less – The Path to Better Design – http://goo.gl/VuTl4
- Demeter is for Encapsulation – http://is.gd/eeyLx
- Opinionated Modular Code – http://is.gd/eeyXm
- Scaling to Hundreds of Millions of Requests – http://vimeo.com/12814529
- Confident Code – http://goo.gl/VFLX
- Destroy All Software Screencasts – https://www.destroyallsoftware.com/screencasts
- Corey Haines: Fast Rails Tests – http://goo.gl/Va2gb
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 MyException < StandardError | |
def initialize(args, action_to_take) | |
#message d'erreur | |
puts 'hehe' | |
#on redirige ou render ou autres.. | |
action_to_take.call | |
end | |
end | |
def foo |
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
for f in *.flv; do target=`basename "$f" .flv`; echo $target; mv "$f" "$target.mp3";done; |
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 App < Sinatra::Base | |
configure :development do | |
set :raise_errors, true | |
#when set to true display a nice exception page for dev but prevent exception handler from working | |
set :show_exceptions, false | |
end | |
get '/someroute' do | |
MyModel.might_generate_an_exception |
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
\d list dbs | |
\c 'mydatabase' | |
\d -> list tables | |
\d 'table' |
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
# put this into your config/eydeploy.rb | |
def bundle | |
if File.exist?("#{c.release_path}/Gemfile") | |
info "~> Gemfile detected, bundling gems" | |
lockfile = File.join(c.release_path, "Gemfile.lock") | |
bundler_installer = if File.exist?(lockfile) | |
get_bundler_installer(lockfile) | |
else | |
warn_about_missing_lockfile |
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
open `find . -name '*.xcodeproj' -prune -o -name '*.xcworkspace' -print` |
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
UIImage *originalImage = [UIImage imageNamed:@"myiconname"]; | |
UIImage *tintedImage = [originalImage imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; | |
UIImageView *imageView = [[UIImageView alloc] initWithImage:tintedImage]; | |
imageView.tintColor = [UIColor redColor]; | |
imageView.frame = CGRectMake(?, ?, ?, ?); | |
[self.view addSubview:imageView]; |
OlderNewer