Skip to content

Instantly share code, notes, and snippets.

Given /^(?:すべてのメールをクリアする|メールボックスが空になっている)$/ do
reset_mailer
end
# Use this step to open the most recently sent e-mail.
When /^メールを開く$/ do
open_email(current_email_address)
end
When /^"([^']*?)" のメールを開く$/ do |address|
# -*- ruby -*-
require 'autotest/redgreen'
module Autotest::Growl
def self.growl title, msg, img="~/.rails_ok.png", pri=0, sticky=""
msg += " at #{Time.now.strftime('%Y-%m-%d %H:%M:%S')}"
system "growlnotify -n autotest --image #{img} -p #{pri} -m #{msg.inspect} #{title} #{sticky}"
end
Autotest.add_hook :ran_command do |at|
results = [at.results].flatten.join
let colors_name = "basic"
" Remove all hiing
hi clear Constant
hi clear Number
hi clear Statement
hi clear PreProc
hi clear Type
hi clear Special
hi clear Identifier
javascript:var getTinyURL=function(longURL,success){var ud='json'+(Math.random()*100).toString().replace(/\./g,''),api='http://json-tinyurl.appspot.com/?url=';window[ud]=function(o){success&&success(o.tinyurl);};document.getElementsByTagName('body')[0].appendChild((function(){var s=document.createElement('script');s.type='text/javascript';s.src=api+encodeURIComponent(longURL)+'&callback='+ud;return s;})());};getTinyURL('http://runeleaf.net',function(tinyurl){location.href='http://twitter.com/home?status='+encodeURIComponent('Browsing: '+document.title+' '+tinyurl)});
@runeleaf
runeleaf / vim.rb
Created May 29, 2011 13:52 — forked from uasi/vim.rb
Vim formula for Homebrew
require 'formula'
class Vim < Formula
homepage 'http://www.vim.org/'
url 'ftp://ftp.vim.org/pub/vim/unix/vim-7.3.tar.bz2'
head 'https://vim.googlecode.com/hg/'
sha256 '5c5d5d6e07f1bbc49b6fe3906ff8a7e39b049928b68195b38e3e3d347100221d'
version '7.3.206'
def features; %w(tiny small normal big huge) end
rm -rf `find ./ -type d -name .svn ! -regex \.svn/. -print`
for FILE in `find . -type f -name "*.html" -exec grep -l '"/stylesheets' \{\} \;` ; do perl -p -i -e 's/\"\/stylesheets/\".\/stylesheets/g' $FILE; done
for FILE in `find . -type f -name "*.html" -exec grep -l '"/javascripts' \{\} \;` ; do perl -p -i -e 's/\"\/javascripts/\".\/javascripts/g' $FILE; done
for FILE in `find . -type f -name "*.html" -exec grep -l '"/images' \{\} \;` ; do perl -p -i -e 's/\"\/images/\".\/images/g' $FILE; done
for FILE in `find . -type f -name "*.js" -exec grep -l '"/javascripts' \{\} \;` ; do perl -p -i -e 's/\"\/javascripts/\".\/javascripts/g' $FILE; done
@runeleaf
runeleaf / gist:1843526
Created February 16, 2012 09:10
rm -rfをgit rm一括
git st | grep deleted: | awk '{print $3}' | xargs git rm
@runeleaf
runeleaf / gist:3311681
Created August 10, 2012 06:18
CameraController
#coding: utf-8
class CameraController < UIViewController
def loadView
self.view = UIImageView.alloc.init
end
def viewDidLoad
BW::Device.camera.any.picture(media_types: [:movie, :image]) do |result|
image = result[:original_image]
image_view = UIImageView.alloc.init
@runeleaf
runeleaf / gist:3486056
Created August 27, 2012 06:03
BluetoothController
#coding: utf-8
class BluetoothController < UIViewController
attr_accessor :session, :peer_id, :peers, :state, :text_field
def viewDidLoad
self.title = 'bluetooth test'
self.view.backgroundColor = "#FFFFFF".to_color
screen = UIScreen.mainScreen.bounds
self.text_field = UITextField.alloc.initWithFrame [[0, 30], [200, 26]]