Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Tomohiro Nishimura Sixeight

🏠
Working from home
View GitHub Profile
View gist:3922429
# 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)
View gist:3397935
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
View cassandra-07.rb
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
@Sixeight
Sixeight / gist:2774265
Created May 23, 2012
master ブランチを rebase するときのメモ
View gist:2774265
$ git fetch --all
$ git stash
$ git checkout mine
$ git rebase origin/master
$ git stash pop
View gist:2309491
# 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 }
View gist:1896800
# coding: utf-8
class Hoge
def prefix(prefix)
@prefix ||= []
@prefix << prefix
end
def with_prefix(meth)
return [@prefix.pop, meth].join('_')
end
View olm.rb
require 'rubygems'
require 'ffi-portaudio'
def safe
r = nil
Thread.new {
$SAFE = 4
r = yield
}.join
r
View gist:1167633
# 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
@Sixeight
Sixeight / cassandra6.rb
Created Jul 5, 2011
diff から起したのでもしかすると動かないかも
View cassandra6.rb
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
View skktools.rb
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}"