Skip to content

Instantly share code, notes, and snippets.

View PharaohKJ's full-sized avatar
👺
Ten-goods come on! Working from home

ふぁらお加藤 PharaohKJ

👺
Ten-goods come on! Working from home
View GitHub Profile
@PharaohKJ
PharaohKJ / boolean_spec.rb
Created January 25, 2016 00:41
rspecでboolean値をテストする
RSpec::Matchers.define :be_boolean do
match do |actual|
expect(actual).to satisfy { |x| x == true || x == false }
end
end
it 'is boolean' do
expect(true).to be_boolean
end
def ensure_em
unless EventMachine.reactor_running? && EventMachine.reactor_thread.alive?
Thread.new { EventMachine.run }
sleep 1
end
end
@PharaohKJ
PharaohKJ / gist:ceb2081a94f2066dcfe8
Created May 28, 2015 03:41
show_md_style_link_bookmarklet
javascript:(function(){window.prompt('選択してコピーしてください','['+document.title+']'+'('+document.URL+')');})();
git checkout --orphan <new_branch>
git rm -rf .
<create document files>
git add .
git commit
[pharaohkj]$ defaults write com.apple.dock expose-animation-duration -float 0.15; killall Dock
[pharaohkj]$ defaults write com.apple.dock expose-animation-duration -int 0; killall Dock
@PharaohKJ
PharaohKJ / gist:d62c9ecc48d55a86d020
Created February 4, 2015 03:07
osxでconsoleにいてworking directoryのgithub上のmasterブランチを開く
open `git remote -v|grep origin|grep git@github|head -n1|sed -e 's#origin.*git@\(.*\)\:\(.*\).git.*#https:\/\/\1\/\2\/#'`tree/master/$(pwd |sed -e "s|`git rev-parse --show-toplevel`/||")
@PharaohKJ
PharaohKJ / gist:2f767d114f4fc6f0a2ee
Created December 8, 2014 10:20
base64ed_black1x1gif
data:image/gif;base64,R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs=
@PharaohKJ
PharaohKJ / gist:eb3fc5830ddf555a792d
Created December 8, 2014 10:20
base64ed_transparent1x1gif
data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7
@PharaohKJ
PharaohKJ / gist:e0cf36931e64017e3d8e
Created October 28, 2014 05:31
installed_brew_packages.txt
[pharaohkj]$ brew list
ansible ctags gdbm libpng neon python scons
autoconf docker git-flow libtool nkf rabbitmq sqlite
bdw-gc etcd imagemagick libyaml node rbenv subversion17
bison etcdctl jmeter markdown openssl readline w3m
boot2docker fleetctl jpeg mosquitto pkg-config redis watch
c-ares freetype jq mysql pstree ruby-build wget
@PharaohKJ
PharaohKJ / record_no_to_order.sql
Created August 29, 2014 11:06
行番号をorderカラムにする
SET @i := 0;
UPDATE `tablename` SET `order` = (@i := @i +1);