Skip to content

Instantly share code, notes, and snippets.

View tchikuba's full-sized avatar

Tsutomu Chikuba tchikuba

View GitHub Profile
@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')
# In your test_helper.rb
class ActiveRecord::Base
mattr_accessor :shared_connection
@@shared_connection = nil
def self.connection
@@shared_connection || retrieve_connection
end
end
@jeffery
jeffery / selenium
Created July 6, 2011 22:51 — forked from robinhoode/selenium
/etc/init.d/selenium
#!/bin/bash
# TODO: http://wiki.debian.org/LSBInitScripts
DESC="Selenium server"
RUN_AS=root
JAVA_BIN=/usr/bin/java
SELENIUM_DIR=/etc/selenium
PID_FILE="$SELENIUM_DIR/selenium.pid"
@kiwofusi
kiwofusi / c.bat
Created November 14, 2011 20:33
RailsInstaller付属のRubyのirbが妙に重い件
rails console --sandbox -- --noreadline
@lancejpollard
lancejpollard / node-folder-structure-options.md
Created November 28, 2011 01:50
What is your folder-structure preference for a large-scale Node.js project?

What is your folder-structure preference for a large-scale Node.js project?

0: Starting from Rails

This is the reference point. All the other options are based off this.

|-- app
|   |-- controllers
|   |   |-- admin
"------------------------------------
" neosnippet
"------------------------------------
" neosnippet "{{{
" snippetを保存するディレクトリを設定してください
" example
" let s:default_snippet = neobundle#get_neobundle_dir() . '/neosnippet/autoload/neosnippet/snippets' " 本体に入っているsnippet
" let s:my_snippet = '~/snippet' " 自分のsnippet
" let g:neosnippet#snippets_directory = s:my_snippet
"------------------------------------
" vim-rails
"------------------------------------
""{{{
"有効化
let g:rails_default_file='config/database.yml'
let g:rails_level = 4
let g:rails_mappings=1
let g:rails_modelines=0
" let g:rails_some_option = 1
"------------------------------------
" Unite-rails.vim
"------------------------------------
"{{{
function! UniteRailsSetting()
nnoremap <buffer><C-H><C-H><C-H> :<C-U>Unite rails/view<CR>
nnoremap <buffer><C-H><C-H> :<C-U>Unite rails/model<CR>
nnoremap <buffer><C-H> :<C-U>Unite rails/controller<CR>
nnoremap <buffer><C-H>c :<C-U>Unite rails/config<CR>
@kawamoto
kawamoto / devise.ja.yml
Last active December 12, 2015 06:28 — forked from orzccc/devise.ja.yml
Japanese locale file for "Devise" (2.2) http://github.com/plataformatec/devise/wiki/I18n
#SOURCE https://gist.github.com/orzccc/3104030
ja:
devise:
confirmations:
confirmed: 'アカウントを登録しました。'
# confirmed: 'Your account was successfully confirmed. You are now signed in.'
send_instructions: '登録方法を数分以内にメールでご連絡します。'
# send_instructions: 'You will receive an email with instructions about how to confirm your account in a few minutes.'
send_paranoid_instructions: 'もしあなたのEメールアドレスが見つかった場合、本人確認についてのメールが数分以内に送られます。'
@kennyj
kennyj / gist:4966002
Last active March 14, 2022 02:28
ハイフン付き電話番号に分割
# encoding: utf-8
module TelSplitter
MAP = {
# 市外局番 , 市内局番の桁数のマップ
# http://www.soumu.go.jp/main_sosiki/joho_tsusin/top/tel_number/number_shitei.html のデータを利用
# 固定電話以外の桁数は適当です...
'050' => 4, # IP電話
'070' => 4, # 携帯電話/PHS
'080' => 4, # 携帯電話