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
#!/usr/bin/ruby | |
# | |
# Recursive git pull - will go into first-level subdirectories that are git repos and execute "git pull", stopping on first unsuccessful pull | |
# @Copyleft 2009 Esad Hajdarevic <[email protected]> http://dev.soup.io/ | |
repos = Dir["*/.git"].map {|path| path.chomp!("/.git") } | |
if repos.empty? | |
puts "No git repositories found" | |
else |
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
require 'kyoto' | |
use 'actors/velocity' | |
use 'actors/bound_to_world' | |
use 'game/pausable' | |
use 'game/score' | |
use 'color' | |
use 'collision_detection' | |
class Paddle < Actor |
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
int d = [[n toStringWithDecimalPlaces:0] length]; | |
if (d > decimals) decimals = 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
require File.join(File.dirname(__FILE__),'spec_helper') | |
def parse(str) | |
Timespan.parse(str).map {|span| [span.day_of_week,span.from_h,span.from_m,span.to_h,span.to_m] } | |
end | |
mon,tue,wed,thu,fri,sat,sun = 1,2,3,4,5,6,7 | |
describe Timespan do | |
it 'parses single day/single hourspan' do |
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
esad@gagarin:~/Projects/appscape/vapor(master)$ irb | |
irb(main):001:0> gem 'actionpack', '3.0.0' | |
=> true | |
irb(main):002:0> require 'action_view/helpers/date_helper' | |
NameError: uninitialized constant ActionView::Helpers::TagHelper::ERB | |
from /Library/Ruby/Gems/1.8/gems/actionpack-3.0.0/lib/action_view/helpers/tag_helper.rb:10 | |
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:32:in `gem_original_require' | |
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:32:in `require' | |
from /Library/Ruby/Gems/1.8/gems/actionpack-3.0.0/lib/action_view/helpers/date_helper.rb:2 | |
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:32:in `gem_original_require' |
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
var Store = Brick.Model("Store"); | |
var Chain = Brick.Model("Chain").hasMany(Store,{url:"/chains/<%= id %>/stores.json"}); | |
var Country = Brick.Model("Country").hasMany(Chain); | |
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
# Prefix routes with /api/v1 | |
%w(get post head options put).each do |method| | |
eval <<-RUBY | |
def self.#{method}(path, opts={}, &bk) | |
super("/api/v1"+path,opts,&bk) | |
end | |
RUBY | |
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
Eat as much as you want. | |
Whole foods. | |
Protein rich, low fat. | |
No preservatives except salt. | |
No spices. | |
No industrially processed food, except for packaging (i.e. canned tuna). | |
Low intake of dairy products. | |
Eggs without yolk. | |
Only non-carbonated water and juice made directly from fruit in front of your eyes. | |
Only pure, freshly grind espresso. Two cups/day max. |
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
app1/Gemfile: | |
gem 'a', path: '../gems/a' | |
gem 'b', path: '../gems/b' | |
app2/Gemfile: | |
gem 'a', path: '../gems/a' | |
gem 'b', path: '../gems/b' |
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
use_module(library(date)). | |
event(asleep). | |
event(wokeup). | |
eventdb(Ts,X,I) :- event(X), call(X,Y), parse_time(Y,Ts), aggregate(min(IArg), eventdb(_,_,IArg), IMin), I=IMin+1. | |
asleep('2015-03-28 23:00'). | |
asleep('2015-03-28 22:00'). | |
wokeup('2015-03-28 02:00'). |
OlderNewer