View twitter_edit_code.rb
class TweetsController < ApplicationController | |
def update | |
tweet = Tweet.find(tweet_params[:id]) | |
if tweet.editable_by?(current_user) | |
tweet.update!(body: tweet_params[:body]) | |
end | |
end | |
private |
View projections.json
{ | |
"app/assets/javascripts/router.js": { | |
"command": "jini" | |
}, | |
"app/controllers/api/v1/*_controller.rb": { | |
"command": "apicontroller", | |
"alternate": "spec/controllers/api/v1/%s_controller_spec.rb", | |
"template": "class Api::V1::%SController < ApplicationController\n respond_to :json\nend" | |
}, | |
"app/assets/javascripts/models/*.js": { |
View projections
{ | |
"app/assets/javascripts/router.js.coffee": { | |
"command": "jini" | |
}, | |
"app/controllers/api/v1/*_controller.rb": { | |
"command": "apicontroller", | |
"alternate": "spec/controllers/api/v1/%s_controller_spec.rb", | |
"template": "class Api::V1::%SController < ApplicationController\n respond_to :json\nend" | |
}, | |
"app/assets/javascripts/models/*.js.coffee": { |
View mux-init
# ~/hashrocket/hr/share/mux-init | |
tmux \ | |
split-window -h -t $name \; \ | |
split-window -d -h -t $name \; \ | |
select-layout -t $name main-horizontal &>/dev/null \; \ | |
new-window -a -d -n server -t $name:0 \; \ | |
split-window -d -h -t $name:server \; \ | |
send-keys -t $name:0.2 'vim .' C-m \; \ | |
send-keys -t $name:1.1 'rails s' C-m \; \ |
View gist:7696084
// Detect the Vimium Chrome extension by Evan Hahn (evanhahn.com) | |
;(function(doc) { | |
doc.hasVimium = function() { | |
return doc.getElementsByClassName('vimiumReset').length > 0; | |
}; | |
doc.onDetectVimium = function(callback, scope) { |
View .vimrc
set shiftwidth=2 | |
set number | |
colorscheme molokai | |
set ignorecase | |
if version >= 700 | |
au InsertEnter * hi StatusLine ctermfg=28 ctermbg=white |
View application.css
@import url(http://fonts.googleapis.com/css?family=Roboto:400,700,300,400italic); | |
@import url(http://fonts.googleapis.com/css?family=Maven+Pro:400,500,700); | |
ul, ol { | |
list-style: none; | |
} | |
h1, h2, h3, h4, h5, h6, pre, code { | |
font-size: 1em; | |
} |