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
def substitute_in_envfile(key, env_key=key) | |
return unless ENV[env_key] | |
runshell( | |
"sed -i \"s%@@#{key}@@%#{ENV[env_key]}%\" " + | |
"config/environments/#{ENV['RAILS_ENV']}.rb") | |
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
#!/usr/bin/env ruby | |
# multi.rb | |
#$:.unshift('~/w/ruote/lib') | |
#$:.unshift('~/w/ruote-redis/lib') | |
require 'rubygems' | |
require 'yajl' rescue require '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
#!/usr/bin/env ruby | |
#$:.unshift('~/w/ruote/lib') | |
#$:.unshift('~/w/ruote-redis/lib') | |
require 'rubygems' | |
require 'redis' | |
require 'ruote' | |
require 'ruote-redis' | |
require 'yajl' rescue require '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
$(document).ready( function() { | |
$('#menu').load('menu.html', function() { | |
console.log("loaded!"); | |
//$('.menu > li').each( function(index) { | |
// // console.log("hello world "+ index); | |
// // $(this).find('.submenu').hide(); |
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
class Resources | |
def initialize(x, items) | |
@x = x | |
@items = items | |
@indexed = false | |
end | |
def first | |
index unless @indexed | |
@items.first |
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
class Resources | |
def initialize(x, items) | |
@x = x | |
@items = items | |
end | |
def first | |
@items.first | |
end | |
def create |
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
# encoding: UTF-8 | |
$:.unshift('../ruote/lib') | |
require 'rubygems' | |
require 'zlib' | |
require 'base64' | |
require 'yajl' | |
require 'ruote' |
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
# public enum Planet { | |
# MERCURY (3.303e+23, 2.4397e6), | |
# VENUS (4.869e+24, 6.0518e6), | |
# EARTH (5.976e+24, 6.37814e6), | |
# MARS (6.421e+23, 3.3972e6), | |
# JUPITER (1.9e+27, 7.1492e7), | |
# SATURN (5.688e+26, 6.0268e7), | |
# URANUS (8.686e+25, 2.5559e7), | |
# NEPTUNE (1.024e+26, 2.4746e7); |
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
def self.perform(note) | |
puts "-" * 80 | |
puts "Write #{note}!" | |
client.update(note) | |
puts "-" * 80 | |
rescue Exception => e | |
puts "=" * 80 | |
puts "something went wrong" | |
p e |
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
# | |
# MIT License - (c) 2011 John Mettraux | |
# | |
require 'rubygems' | |
require 'parslet' # gem install parslet | |
module MyJson |