Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
set -u
set -e
# Example init script, this can be used with nginx, too,
# since nginx and unicorn accept the same signals
# Feel free to change any of the following variables for your app:
APP_ROOT=/home/deploy/public_html/rm/current
PID=$APP_ROOT/tmp/pids/unicorn.pid
ENV=production
@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
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')
ja:
errors:
messages:
not_found: "は見つかりませんでした"
# not_found: "not found"
already_confirmed: "は既に登録済みです"
# already_confirmed: "was already confirmed"
not_locked: "は凍結されていません"
# not_locked: "was not locked"
@yuroyoro
yuroyoro / have_same_attributes.rb
Created January 28, 2012 12:14
have_same_attributes : RSpec用Custom Machter。ActiveRecord/ActiverResrouce/Hashなどをゆるふわくmatchさせる
# Rspec用のCustom Matcher
#
# attributesメソッドを持つオブジェクト同士やHashを再帰的にmatchさせる
#
# ActiveRecord/ActiveModel/ActiveResrouce/Hashなどをゆるふわく
# 一致するか調べる。例えば、StringとSymbolは区別しないし、[]や{}やnilは同一視する。
#
# it { should have_same_attributes(hash) }
# it { should have_same_attributes(:foo => 1,:bar => 2) }
#
@chetan
chetan / yardoc_cheatsheet.md
Last active April 16, 2024 23:49
YARD cheatsheet
@ayumin
ayumin / git-dojo.md
Created March 2, 2012 10:59
Git道場実行委員募集

Git道場実行委員募集

3月下旬~4月くらいにGit道場を開催したいと思います。

講義メインではなくてなるべく手を動かす時間をたくさんとり、参加者全員が”怖がらずにmerge/rebaseをできるようになる”というのが目標です。

このイベントに実行委員として参加してくれる方は、下記の形式のメールを送信してください。

To: git-dojo_at_qwik.jp

Cc: ayumu.aizawa_at_gmail.com

@mike-neck
mike-neck / AppengineExternalResource.java
Created April 8, 2012 02:11
@ruleアノテーションを利用したAppengineTestCase
package org.mikeneck.gae.slim3.sample.util;
import org.junit.rules.ExternalResource;
import org.slim3.tester.AppEngineTester;
/**
* @author : mike
* @since : 12/04/08
*/
public class AppengineExternalResource extends ExternalResource {
@rummelonp
rummelonp / faraday.md
Last active May 20, 2022 12:23
Ruby の HTTP クライアントライブラリ Faraday が便利そう

Ruby の HTTP クライアントライブラリ Faraday が便利そう

Ruby の HTTP クライアントライブラリ Faraday が便利そう

API ラッパの開発には [RestClient gem][rest_client_gem] だとか
OAuth の必要なものは [Net/HTTP][net_http] + [OAuth gem][oauth_gem] を使ってた

[Twitter gem][twitter_gem] や [Instagram gem][instagram_gem] など API ライブラリのソースを読んでみると
[Faraday gem][faraday_gem] というものがよく使われてた

@thealscott
thealscott / jquery.autolink.js
Created May 29, 2012 15:19
Extension of the handy autolink jQuery plugin, so that it has a method for handling twitter hashtags. Original from http://kawika.org/jquery/index.php
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs