Skip to content

Instantly share code, notes, and snippets.

View kazuph's full-sized avatar

Kazuhiro Homma kazuph

View GitHub Profile
@kazuph
kazuph / file0.html
Created May 26, 2014 08:37
viewのdate_selectでyear, month, dayで別々のclassを当てたいときどうするか? ref: http://qiita.com/kazuph/items/3c540ba442ae5d597636
> f.date_select_or_confirm :birth_date, {}, {class: "date"}
<select class="date" id="user_birth_date_1i" name="user[birth_date(1i)]">
<select class="date" id="user_birth_date_2i" name="user[birth_date(2i)]">
<select class="date" id="user_birth_date_3i" name="user[birth_date(3i)]">
※<option>は省略してます。
@kazuph
kazuph / main.go
Created May 17, 2014 14:10
Raspberry Piでgolangのサーバーを立てる。
package main
import (
"fmt"
"github.com/codegangsta/martini"
"os/exec"
)
func main() {
m := martini.Classic()
# 競合するgdbがないなら必要ない
# 普通にbrewで入れたらgdbコマンドが使える
alias gdbnew='/usr/local/Cellar/gdb/7.6/bin/gdb'
@kazuph
kazuph / file0.txt
Created May 16, 2014 10:10
PDFを HTMLに 変換する!!! ref: http://qiita.com/kazuph/items/6d14e29cbdbb4b9ee9a9
brew install pdftohtml
@kazuph
kazuph / db.go
Created April 30, 2014 23:20
gorpでサーバー起動時に自動でCREATE DADABASEする ref: http://qiita.com/kazuph/items/75f8e10d73aeaeb19dd7
package main
import (
"database/sql"
"github.com/coopernurse/gorp"
_ "github.com/go-sql-driver/mysql"
"log"
)
type PostInfo struct {
@kazuph
kazuph / file0.go
Created April 27, 2014 03:20
golangで配列と配列の連結 ref: http://qiita.com/kazuph/items/4bc33162da7e7d00d80c
slice1 = append(slice1, slice2)
@kazuph
kazuph / file0.txt
Created April 26, 2014 06:42
supervisord + unicornでhot restart (deploy) する ref: http://qiita.com/kazuph/items/55a5f74b9dca2d17bd65
pip install git+https://github.com/kazuph/unicornherder.git
@kazuph
kazuph / bijo_gif_url.rb
Created April 19, 2014 14:36
まとめからgif画像のURLを抽出するだけのスクリプト
require "mechanize"
class BijoGifUrl
class << self
def execute()
new().urls
end
end
@kazuph
kazuph / ja.yml
Created April 14, 2014 14:05
rails_adminでenumな値は数字でなくlocaleの値を表示させたい ref: http://qiita.com/kazuph/items/1cff00ae73f7a42d01fb
ja:
gender:
- '男性'
- '女性'
@kazuph
kazuph / Gemfile
Created April 14, 2014 08:19
Railsを本番稼働させるときはnginxとsession storeの設定に注意 ref: http://qiita.com/kazuph/items/feb135cda2c6ece24574
+gem 'activerecord-session_store'