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
# coding: utf-8 | |
fetcher = Takeyamachi::Config.platforms.map do |platform| | |
Takeyamachi::FetcherFactory.create(platform) | |
end | |
Forever.run do | |
before :all do | |
fetchers.each do |fetcher| | |
config = Takeyamachi::Config.get(fetcher.platform) |
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
5:55:> rbenv install 2.0.0-dev | |
Downloading http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz... | |
Installing yaml-0.1.4... | |
Installed yaml-0.1.4 to /Users/tomohiro/.rbenv/versions/2.0.0-dev | |
Cloning https://github.com/ruby/ruby.git... | |
Installing ruby-2.0.0-dev... | |
BUILD FAILED | |
Inspect or clean up the working tree at /var/folders/cb/1lmqy4c97fngmt0qqxdb_qzc0000gn/T/ruby-build.20120820055546.34146 |
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 Cassandra07 < Formula | |
url 'http://ftp.riken.jp/net/apache//cassandra/0.7.10/apache-cassandra-0.7.10-bin.tar.gz' | |
homepage 'http://cassandra.apache.org' | |
md5 'f0183e67d27178a0d42f56f4dbea4f6e' | |
def install | |
(var + "lib/cassandra-0.7").mkpath | |
(var + "log/cassandra-0.7").mkpath |
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
$ git fetch --all | |
$ git stash | |
$ git checkout mine | |
$ git rebase origin/master | |
$ git stash pop |
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
# coding: utf-8 | |
require 'open-uri' | |
require 'nokogiri' | |
URL = 'http://www.google.com/doubleclick/studio/swiffy/releasenotes.html' | |
doc = Nokogiri::HTML(open(URL)) | |
puts releases = doc.css('div.releaseNotesItem').map {|div| div.css('p').text } |
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
# coding: utf-8 | |
class Hoge | |
def prefix(prefix) | |
@prefix ||= [] | |
@prefix << prefix | |
end | |
def with_prefix(meth) | |
return [@prefix.pop, meth].join('_') | |
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 'rubygems' | |
require 'ffi-portaudio' | |
def safe | |
r = nil | |
Thread.new { | |
$SAFE = 4 | |
r = yield | |
}.join | |
r |
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
# coding: utf-8 | |
module NaturalOrderStringComparison | |
COMPARE_EXPRESSION = /^(\D*)(\d*)(.*)$/.freeze | |
def compare(str1, str2) | |
str1, str2 = str1.dup, str2.dup | |
while (str1.length > 0) || (str2.length > 0) 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
require 'formula' | |
class Cassandra < Formula | |
url 'http://www.mirrorservice.org/sites/ftp.apache.org//cassandra/0.6.13/apache-cassandra-0.6.13-bin.tar.gz' | |
homepage 'http://cassandra.apache.org' | |
md5 '9041e7a02e9d162406028fe8c7a63d39' | |
def install | |
(var+"lib/cassandra").mkpath |
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 Skktools < Formula | |
url 'http://openlab.ring.gr.jp/skk/tools/skktools-1.3.2.tar.gz' | |
homepage 'http://openlab.ring.gr.jp/skk/' | |
md5 '88861ccbe74180b2a7bacfc25484409d' | |
version '1.3.2' | |
def install | |
system "./configure", "--disable-debug", "--disable-dependency-tracking", "--prefix=#{prefix}" |