Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env ruby
spec_hits = []
checks = {
'_spec\.rb$' => ['focus:[:space:]*true'],
'\.rb$' => ['binding\.pry', 'debugger']
}
# Find the names of all the filenames that have been (A)dded (C)opied or (M)odified
filenames = `git diff --cached --name-only --diff-filter=ACM`.split("\n")
@tatsuosakurai
tatsuosakurai / application.js
Last active August 29, 2015 14:00
JavaScript Setting for Rails Controller
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// compiled file.
//
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
<% repo = Grit::Repo.new(Rails.root).head.name rescue nil %>
development:
adapter: mysql2
encoding: utf8
database: hoge_development<%= "_#{repo}" %>
javascript:var d=document,t=d.title,u=d.URL,i=d.createElement('input');i.value='['+t+']('+u+' )';d.body.appendChild(i);i.focus();i.select();

TODO

  • 宿に21:30くらいに付く予定だけど晩御飯だしてもらえるか確認
  • コメント要確認↓

日程(予定)

  • 9/4金:夜20時東京駅(銀の鈴)集合、新幹線のチケット(20:26発 こだま687号(N700系)(名古屋行)
@tatsuosakurai
tatsuosakurai / tork05_sample
Created January 9, 2011 07:13
tork05用メアドをランダムに抽出
require "csv"
MAX = 50
EXISTING = 18
EMAILCOLNUM = 5
DUPLICATE = 1
def create_data
result = []
#csv取得
@tatsuosakurai
tatsuosakurai / 3select_box.html
Created April 25, 2011 06:37
3連セレクトボックス
<html>
<head>
<meta charset="UTF-8">
<title></title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
</head>
<body>
<select id="select1">
<option value="">-----</option>
<option value="00110">親さくらい</option>
@tatsuosakurai
tatsuosakurai / scroll_up_and_down_button.erb
Created May 6, 2011 05:59
ボタン押しっぱなし
<div id="scroller_up"><%= image_tag 'btn_up.jpg' %></div>
<div id="scroller_down"><%= image_tag 'btn_down.jpg' %></div>
<%= javascript_tag do %>
var scroll_up_flg = true;
var scroll_down_flg = true;
Event.observe('scroller_up', 'mousedown', scroll_up_start);
Event.observe('scroller_up', 'mouseup', scroll_up_off);
Event.observe('scroller_down', 'mousedown', scroll_down_start);
Event.observe('scroller_down', 'mouseup', scroll_down_off);
@tatsuosakurai
tatsuosakurai / gist:1161697
Created August 22, 2011 05:05
rails memo
# blank project
rails new app_name -T -J -d mysql
cd app_name
bundle
# rails g jquery:install #3.1、3.2から不要?
rails g rspec:install
rails g controller sample index
rails g model book name:string hoge:integer user:references
rake db:migrate
@tatsuosakurai
tatsuosakurai / gist:1208385
Created September 10, 2011 14:50
DRYのサンプル
people[:name] ||= 'sakurai'
unless people[:name]
people[:name] = 'sakurai'
end