Skip to content

Instantly share code, notes, and snippets.

View Sixeight's full-sized avatar
🏠
Working from home

Tomohiro Nishimura Sixeight

🏠
Working from home
View GitHub Profile
@Sixeight
Sixeight / fast_rspec.rb
Created March 1, 2011 14:11
はやい、Spork ひつよー。 via @jugyo http://blog.twiwt.org/e/cafcfe
#!/usr/bin/env ruby
##
# script/spec_server_irb
require 'drb'
require 'irb'
require 'g'
class FastRSpec
def hoge
yield 2
end
x = 5
hoge do |x|
p x
p local_variables
end
" 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',
@Sixeight
Sixeight / unite-html5.vim
Created December 3, 2010 20:50
発表用、あとでちゃんと作る
" 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)
@Sixeight
Sixeight / grep.vim
Created December 2, 2010 07:19
unite-grep: grep source for unite.vim
" 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)
@Sixeight
Sixeight / ruby_advent.vim
Created December 1, 2010 11:24
Ruby Advent Calendar jp source for unite.vim (need mattn's webapi-vim: https://github.com/mattn/webapi-vim)
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)
#! /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
#! /usr/bin/env ruby
# -*- coding: utf-8 -*-
require 'uri'
class DrupalCtl
class << self; private :new end
def self.instance(type = :theme, options = {})
#! /usr/bin/env ruby
# -*- coding: utf-8 -*-
require 'uri'
$settings = {
:wordpress_dir => '/var/www/wordpress'
}
def show_list
# 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));
});
});