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}" |
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 | |
## | |
# script/spec_server_irb | |
require 'drb' | |
require 'irb' | |
require 'g' | |
class FastRSpec |
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
def hoge | |
yield 2 | |
end | |
x = 5 | |
hoge do |x| | |
p x | |
p local_variables | |
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
" unite-grep-quickfix {{{ | |
let s:unite_grep_quickfix = { 'name': 'grep-quickfix', 'is_volatile': 1 } | |
function! s:unite_grep_quickfix.gather_candidates(args, context) | |
execute printf("vimgrep /%s/jg %s", a:context.input, get(a:args, 0, "**")) | |
let l:res = [] | |
for l:val in getqflist() | |
let name = bufname(l:val.bufnr) | |
let dict = { | |
\ 'word': printf("%s|%d:%d|%s", name, l:val.lnum, l:val.col, matchstr(l:val.text, '\s*\zs.*\S')), | |
\ 'source': 'grep-quickfix', |
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
" list kind {{{ | |
let s:kind_list = { | |
\ 'name' : 'list', | |
\ 'default_action' : 'list', | |
\ 'action_table': {}, | |
\} | |
let s:kind_list.action_table.list = { | |
\ 'description' : 'list with selected key', | |
\ } | |
function! s:kind_list.action_table.list.func(candidate) |
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
" grep source for unite.vim | |
" | |
" setting example: | |
" | |
" let g:unite_source_grep_default_dir = '~/.vim' | |
" let g:unite_source_grep_default_opts = '-iR' | |
let s:grep_source = { 'name': 'grep', 'is_volatile': 1 } | |
function! s:grep_source.gather_candidates(args, context) | |
let l:directory = get(a:args, 0, g:unite_source_grep_default_dir) |
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
let s:save_cpo = &cpo | |
set cpo&vim | |
let s:source_ruby_advent_jp = { 'name': 'ruby_advent_jp' } | |
let s:source_ruby_advent_en = { 'name': 'ruby_advent_en' } | |
let s:ruby_advent_jp = [] | |
let s:ruby_advent_en = [] | |
function! unite#sources#ruby_advent#open_url(url) |
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 | |
# | |
# Install: zen, ccs, views, devel, theme developer | |
# Make: Custom theme based on zen. | |
# | |
echo -n 'drupal path: ' | |
read path | |
drupalctl -d $path theme add http://ftp.drupal.org/files/projects/zen-6.x-1.1.tar.gz |