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
package { | |
public class Test { | |
public function Test(){ | |
trace("test!"); | |
} | |
} | |
} | |
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
/** | |
* 関数クラスのユーティリティメソッド | |
* @author Mitsuru Haga <[email protected]> | |
* @version 2009/03/02 23:10 | |
*/ | |
class com.func09.utils.FunctionUtil { | |
/** | |
* スコープ付き関数を取得する | |
* @param func | |
* @param target |
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 com.func09.utils.ObjectUtil { | |
/** | |
* MIX-INメソッド | |
* @param destination | |
* @param source | |
*/ | |
public static function extend( destination:Object, source:Object ){ | |
for( var prop:String in source ) | |
destination[prop] = source[prop]; |
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
# template.rb | |
run "rm public/index.html" | |
generate(:scaffold, "todo title:string finished:boolean") | |
route "map.root :controller => 'todos'" | |
rake("db:migrate") | |
git :init | |
git :add => "." | |
git :commit => "-a -m 'Initial commit'" |
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 Logger | |
def format_message(severity, timestamp, progname, msg) | |
"[#{severity}] #{progname} #{timestamp.strftime("%Y-%m-%d %H:%M:%S")} (#{$$}) : #{msg}\n" | |
end | |
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 | |
require 'yaml' | |
DEFINES = YAML.load <<-"EOS" | |
- | |
param1: aaa | |
param2: bbb | |
- |
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
% rake spec | |
(in /path/to/func09_bdd_on_rails_sample) | |
Friendship | |
should create a new instance given valid attributes | |
User | |
フォローを止める時 | |
失敗するパターン | |
フォローしてない相手なら失敗(例外発生)すること (PENDING: Not Yet Implemented) | |
成功するパターン | |
成功すること (PENDING: Not Yet Implemented) |
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
# Copy database.yml | |
run "cp config/database.yml config/database.yml.sample" | |
# Delete unnecessary files | |
run "rm README" | |
run "rm public/index.html" | |
# Add .gitignore | |
run "touch tmp/.gitignore log/.gitignore vendor/.gitignore" | |
run %{find . -type d -empty | grep -v "vendor" | grep -v ".git" | grep -v "tmp" | xargs -I xxx touch xxx/.gitignore} |
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 'twitpic' | |
oauth = TwitPic::OAuth.new(CONSUMER_KEY, CONSUMER_SECRET) | |
oauth.authorize_from_access(ACCESS_TOKEN, ACCESS_SECRET) | |
client = TwitPic::Base.new(API_KEY, oauth) | |
pp client.upload('/path/to/image','message..') |
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
h1 { | |
font-size: 138.5%; } | |
h2 { | |
font-size: 123.1%; } | |
h3 { | |
font-size: 108%; } | |
h1, h2, h3 { | |
margin: 1em 0; } | |
h1, h2, h3, h4, h5, h6, strong { | |
font-weight: bold; } |
OlderNewer