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 |
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 | |
# -*- coding: utf-8 -*- | |
require 'uri' | |
class DrupalCtl | |
class << self; private :new end | |
def self.instance(type = :theme, options = {}) |
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 | |
# -*- coding: utf-8 -*- | |
require 'uri' | |
$settings = { | |
:wordpress_dir => '/var/www/wordpress' | |
} | |
def show_list |
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
# Glitch all images. | |
jetpack.tabs.onReady(function (doc) { | |
if (doc.defaultView.frameElement) { return } | |
$(doc).find('img').each(function() { | |
$(this).attr('src', 'http://hitode909.appspot.com/glitch/api?uri=' + encodeURIComponent(this.src)); | |
}); | |
}); |