This file contains 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
// Caller, a subclass of UITableViewCell. Only have a method | |
- (void) drawRect:(CGRect)rect | |
{ | |
CGContextRef context = UIGraphicsGetCurrentContext(); | |
CGColorRef whiteColor = [UIColor whiteColor].CGColor; | |
CGColorRef lightGrayColor = [UIColor colorWithRed:230.0/255.0 | |
green:230.0/255.0 | |
blue:230.0/255.0 | |
alpha:1.0].CGColor; |
This file contains 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
## Classic | |
accepts_nested_attributes_for :addresses, reject_if: :all_blank, allow_destroy: true | |
accepts_nested_attributes_for :client_detail, reject_if: :all_blank, allow_destroy: true | |
## with_options | |
with_options reject_if: :all_blank, allow_destroy: true do |u| | |
u.accepts_nested_attributes_for :addresses | |
u.accepts_nested_attributes_for :client_detail | |
end |
This file contains 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
ary = [1, 2, 3] | |
_.each(ary, function(item) { console.log(item); }) | |
_(ary).each(function(item) { console.log(item); }) |
This file contains 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
namespace :mailers do | |
desc 'Send the "congrats" mail' | |
task congrats: :environment do | |
lists = Photobook.distinct_list_for_date Date.yesterday | |
lists.each do |list| | |
book = list.most_recent_book | |
if book.present? | |
mailer = Routines.congrats(book) |
This file contains 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
# Classic aliases | |
alias bx='bundle exec' | |
alias bs='bundle show' | |
alias bu='bundle update' | |
alias bo='bundle open' | |
alias bxsc='bundle exec script/console' | |
alias bxrc='bundle exec rails console' | |
alias bxcs='bundle exec cap staging' | |
alias bxcp='bundle exec cap production' |
This file contains 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*) |
This file contains 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
15:12:41] <ksol> les potes de mon asso étudiant s'occupent de l'accueil des nouveaux rentrants la | |
[15:13:03] <ksol> et chaque année ils font un faux cours avec un vrai (ou faux) prof qui les bullshit durant une demi heure pour les faire flipper leurs mère | |
[15:13:16] <ksol> cette année ils en ont pas trouvé, et j'me suis proposé | |
[15:13:16] <@lda> haha ok | |
[15:13:33] <ksol> je prends vos idées stupides, je sais que y'en a à revendre par ici | |
[15:16:06] <@lda> c'est quel genre de BS qu'il te faut ? | |
[15:20:34] <ksol> bah hm par exemple, y'a quelques années, un prof faisait un cours sur la complexité et les classes de complexité | |
[15:20:51] <ksol> et du fait que y'avait de nouvelles classes qui étaient apparues suite à internet, tout ça | |
[15:25:44] <ksol> notamment les modulations embarquées (modem), les unifications de modulations postérieures (ump), bref, tu vois le genre | |
[15:25:49] <ksol> bref, je pensais faire un truc utile |
This file contains 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
[ksol@Thrace] [1.8.7-p358 4.1.0 master] $ irb | |
irb(main):001:0> RUBY_VERSION | |
=> "1.8.7" | |
irb(main):002:0> hsh = {:a => 1} | |
=> {:a=>1} | |
irb(main):003:0> hsh[:a] = nil | |
=> nil | |
irb(main):004:0> hsh | |
=> {:a=>nil} |
This file contains 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
MyApp.ApplicationAdapter = DS.RESTAdapter.extend({ | |
buildURL: function() { | |
var base; | |
base = this._super.apply(this, arguments); | |
return "" + base + ".json"; | |
} | |
}); |
This file contains 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
Application.IndexRoute = Ember.Route.extend | |
sections: | |
label1: url1 | |
label2: url2 | |
label3: url3 | |
labels: (-> | |
Ember.keys @get('sections') | |
).property('sections') |
OlderNewer