Skip to content

Instantly share code, notes, and snippets.

@necrodome
necrodome / capybara cheat sheet
Last active September 4, 2016 18:14 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@necrodome
necrodome / run.sh
Created May 22, 2013 23:19
Run mozart2 on mac os x from /usr/local
/Applications/Emacs.app/Contents/MacOS/Emacs --eval '(setq load-path (cons "'$OZHOME'/share/mozart/elisp" load-path))' -l oz.elc -f run-oz

Twitter公式クライアントのコンシューマキー

Twitter for iPhone

Consumer key: IQKbtAYlXLripLGPWd0HUA
Consumer secret: GgDYlkSvaPxGxC4X8liwpUoqKwwr3lCADbz8A7ADU

Twitter for Android

Consumer key: 3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for iPad

Consumer key: CjulERsDeqhhjSme66ECg

D, [2013-01-05T04:05:48.257715 #67253] DEBUG -- : USING JID: blather-test@jabber.org
D, [2013-01-05T04:05:48.292271 #67253] DEBUG -- : SENDING: (/Volumes/MacintoshHD/Users/moon/.rvm/gems/ruby-1.9.3-p327-turbo@blather-test/gems/blather-0.8.1/lib/blather/stream/client.rb:21:in `start') <stream:stream to='jabber.org' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' xml:lang='en' >
D, [2013-01-05T04:05:48.330570 #67253] DEBUG -- : RECEIVING (stream) <stream:stream xmlns:stream="http://etherx.jabber.org/streams" from="jabber.org" id="77bf7a740ec9a36b" version="1.0"/>
D, [2013-01-05T04:05:48.331778 #67253] DEBUG -- : RECEIVING (features) <stream:features xmlns:stream="http://etherx.jabber.org/streams">
<starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"/>
<mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl">
<mechanism>CRAM-MD5</mechanism>
<mechanism>LOGIN</mechanism>
<mechanism>PLAIN</mechanism>
<mechanism>DIGEST-MD5</mechanism>
# jython 2.5.2 - Os X Lion
sys.path.append(os.getcwd() + "/zemberek-tr-2.1.1.jar")
sys.path.append(os.getcwd() + "/zemberek-cekirdek-2.1.1.jar")
from net.zemberek.erisim import Zemberek
from net.zemberek.tr.yapi import TurkiyeTurkcesi
zemberek = Zemberek(TurkiyeTurkcesi())
zemberek.kokBulucu().kokBul("evli") # array(net.zemberek.yapi.Kok, [ev ISIM , evli ISIM ])
jruby-1.6.2 > ["urls.rb", "config/urls.rb", "mailers/*.rb", "mailers.rb"].map { |file| Dir[File.join("/Users/moon/Tmp/test_app", file)] }.flatten
=> ["/Users/moon/Tmp/test_app/urls.rb"]
jruby-1.6.2 > require 'torquebox-vfs'
=> true
jruby-1.6.2 > ["urls.rb", "config/urls.rb", "mailers/*.rb", "mailers.rb"].map { |file| Dir[File.join("/Users/moon/Tmp/test_app", file)] }.flatten
=> ["/Users/moon/Tmp/test_app/urls.rb", "/Users/moon/Tmp/test_app/config/urls.rb", "/Users/moon/Tmp/test_app/mailers.rb"]
require 'net/http'
require 'uri'
require 'json'
# sudo gem install json
# Usage example:
# putio = Putio.new("YOUR_API_KEY","YOUR_API_SECRET")
# puts JSON.parse(putio.user.friends.get)
# puts JSON.parse(putio.search :query => "massive attack"
@necrodome
necrodome / polarize_photos.rb
Created May 28, 2009 05:17
give polarized effect to a photo
require 'RMagick'; include Magick
def polarize_photo(photo_url, photo_caption, pointsize = 14, font_family = 'Rufscript')
p = Image.read(photo_url)[0]
p[:Caption] = photo_caption
r = (-10..10).to_a[rand(20)]
p.polaroid(r) do
self.pointsize = pointsize
self.font_family = font_family
end