Skip to content

Instantly share code, notes, and snippets.

View func09's full-sized avatar

Mitsuru Haga func09

View GitHub Profile
package {
public class Test {
public function Test(){
trace("test!");
}
}
}
/**
* 関数クラスのユーティリティメソッド
* @author Mitsuru Haga <mitsuru.haga@gmail.com>
* @version 2009/03/02 23:10
*/
class com.func09.utils.FunctionUtil {
/**
* スコープ付き関数を取得する
* @param func
* @param target
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];
# 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'"
class Logger
def format_message(severity, timestamp, progname, msg)
"[#{severity}] #{progname} #{timestamp.strftime("%Y-%m-%d %H:%M:%S")} (#{$$}) : #{msg}\n"
end
end
#!/usr/bin/env ruby
require 'yaml'
DEFINES = YAML.load <<-"EOS"
-
param1: aaa
param2: bbb
-
% 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)
# 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}
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..')
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; }