Skip to content

Instantly share code, notes, and snippets.

View ppworks's full-sized avatar
🏠
Working from home

Naoto Koshikawa ppworks

🏠
Working from home
View GitHub Profile
@ppworks
ppworks / file0.txt
Created March 13, 2014 06:28
friendly_idのslugがセットされるタイミングっていつなの ref: http://qiita.com/ppworks/items/cdf98639665bc586cbac
before_validation :set_xxxx
extend FriendlyId # extendはもっと上でもいいのでおこのみで
friendly_id :slug_candidates, use: :slugged
@ppworks
ppworks / file0.txt
Created April 10, 2014 00:14
rails4.1にしたときのherokuのdatabase.yml設定 ref: http://qiita.com/ppworks/items/a30ebda446c0204ca6ca
staging:
url: <%= ENV["DATABASE_URL"] %>
production:
url: <%= ENV["DATABASE_URL"] %>
@ppworks
ppworks / gist:d12c1977d89200f13fa2
Last active August 29, 2015 14:02
idobata.io-user-stylesheet.css
.primary-sidebar {
width: 130px;
}
.primary-sidebar footer ul li {
width: 100%;
}
.primary-sidebar footer ul li * {
display: none;
@ppworks
ppworks / gist:9c7e06a8d69425f2fd80
Last active August 29, 2015 14:03
bugsnagがwebhookで投げるパラメータ
=> {
      "error" => {
        "exceptionClass" => "ExampleException",
               "message" => "Something really bad happened",
               "context" => "home#example",
            "appVersion" => "1.0.0",
          "releaseStage" => "production",
           "occurrences" => 42,
         "firstReceived" => "2014-06-26T05:56:04.171Z",
@ppworks
ppworks / gist:e78e52a45167e267ecad
Created November 9, 2014 04:33
pplog-tmux-script
SESSION_NAME=pplog
DIR=~/repository/github.com/ppworks/pplog
tmux new-session -d -s pplog -n server -c "$DIR"
tmux send-keys -t $SESSION_NAME:0 'bundle exec rails s' C-m
tmux new-window -t $SESSION_NAME:1 -n vim -c "$DIR"
tmux send-keys -t $SESSION_NAME:1 'vim' C-m C-t
tmux new-window -t $SESSION_NAME:2 -n git -c "$DIR"
@ppworks
ppworks / file0.txt
Last active August 29, 2015 14:10
railsでもbowerでasset管理しつつherokuにもdeployする方法 ref: http://qiita.com/ppworks/items/9c0e58e5ebe3f1f439eb
$ brew upgrade node
@ppworks
ppworks / application_helper.rb
Last active August 29, 2015 14:13
viewから使えるhelperはデフォルトでController名と同じやつ ref: http://qiita.com/ppworks/items/b6bb04e9235fd75ec341
module ApplicationHelper
def common_helper_method
end
end
@ppworks
ppworks / file0.txt
Created January 17, 2015 06:20
別のrepositoryAでやった全く同じ作業を別のrepositoryBでもやりたい ref: http://qiita.com/ppworks/items/55d000908f70542a7264
git cd repositoryB
git remote add repositoryA git@example.com:repositoryA.git
@ppworks
ppworks / file1.diff
Last active August 29, 2015 14:13
Postモデルから、search_wordsに含まれる単語をAND検索する ref: http://qiita.com/ppworks/items/4de9e7dc324aad2c9f48
- arel_cond.and(condition)
+ arel_cond.or(condition)
@ppworks
ppworks / gist:7af7073e56283495e04f
Last active August 29, 2015 14:19
あまりハズレのない三田ランチ情報