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
module Depot | |
class EmailNotifier < Bluepill::Trigger | |
def initialize(process, options = {}) | |
@to_address = options.delete(:to_address) | |
@from_address = options.delete(:from_address) | |
@notify_on = options.delete(:notify_on) | |
@rails_env = options.delete(:rails_env) | |
super | |
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
require 'formula' | |
class Cairo <Formula | |
url 'http://cairographics.org/releases/cairo-1.8.10.tar.gz' | |
homepage 'http://cairographics.org/' | |
md5 'b60a82f405f9400bbfdcf850b1728d25' | |
depends_on 'pkg-config' => :build | |
depends_on 'libpng' | |
depends_on 'pixman' |
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
diff --git a/tdiary/dispatcher.rb b/tdiary/dispatcher.rb | |
index 4be53ca..ee8ef11 100644 | |
--- a/tdiary/dispatcher.rb | |
+++ b/tdiary/dispatcher.rb | |
@@ -96,7 +96,7 @@ module TDiary | |
body = tdiary.eval_rhtml | |
head['ETag'] = %Q["#{Digest::MD5.hexdigest( body )}"] | |
if ENV['HTTP_IF_NONE_MATCH'] == head['ETag'] and /^GET$/i =~ @cgi.request_method then | |
- head['status'] = CGI::HTTP_STATUS['NOT_MODIFIED'] | |
+ status = CGI::HTTP_STATUS['NOT_MODIFIED'] |
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
oops. this gist is wrong.see http://gist.github.com/729103 |
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 'drb' | |
begin | |
begin | |
DRb.start_service("druby://localhost:0") | |
rescue SocketError, Errno::EADDRNOTAVAIL | |
DRb.start_service("druby://:0") | |
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 ruby19 | |
require 'csv' | |
require 'erb' | |
TEMPLATE = DATA.read | |
@titles = "* Title index\n" | |
@talks = "" | |
def each_entry(row, idx) | |
talk_idx = "%02d" % idx |
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
diff --git a/app/models/rubyist.rb b/app/models/rubyist.rb | |
index 48ef14f..8fe9848 100644 | |
--- a/app/models/rubyist.rb | |
+++ b/app/models/rubyist.rb | |
@@ -4,7 +4,7 @@ class Rubyist < ActiveRecord::Base | |
has_many :contributions | |
validates_uniqueness_of :username | |
- validates_format_of :username, :with => /^[\w-]+$/ | |
+ validates_format_of :username, :with => /^[a-zA-Z_-]+$/ |
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
$ spec -cfn spec/game_spec.rb | |
すべてガターの場合 | |
should == 0 | |
すべて1ピンの場合 | |
should == 20 | |
スペアの場合 | |
次の投球で倒したピンがボーナス加算される | |
ストライクの場合 | |
次のフレームの得点がボーナス加算される | |
ストライク、ガター、スペアの場合 |
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
$:.unshift(File.dirname(__FILE__)) | |
require 'spec_helper' | |
module BowlongGameMacro | |
class BowlongGamePlayer | |
def initialize | |
@game = Game.new | |
end | |
def roll_spare |
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
#!/bin/sh | |
REPO=$1 | |
newgrp src | |
GIT_DIR=/var/cache/git/$REPO git --bare init --shared | |
cd /var/cache/git/empty | |
git push ../$REPO master |