Install jsonlint
to act as syntastic json checker:
$ npm install jsonlint -g
Tell syntatastic about it:
" in your ~/.vimrc
module SqlQueryCountingHelpers | |
# This helper can be used to instrument a segment of test code to analyze the | |
# SQL queries being executed for that portion of the code path. | |
# | |
# It's intended to be used around specific portions of a spec rather than an | |
# entire spec as the FactoryBot usage adds a good amount of noise to the SQL | |
# analysis due to the many objects & associations created. | |
# | |
# Usage example (using spec/requests/api/v1/projects_spec.rb): | |
# |
function! PrintGivenRange() range | |
echo "firstline ".a:firstline." lastline ".a:lastline | |
echo "firstline contents" . getline(a:firstline) | |
echo "lastline contents" . getline(a:lastline) | |
endfunction | |
command! -range PassRange <line1>,<line2>call PrintGivenRange() | |
vmap ,pr :PassRange<cr> |
################################################################# | |
# # | |
# A guide to setting up a linode Ubuntu VPS for # | |
# Ruby on Rails hosting with nginx & passenger # | |
# # | |
# Compiled by Chris Toomey [ctoomey.com] on Sept. 9 2011 # | |
# # | |
################################################################# | |
# Start with base 10.04 image. Setup the DNS for any domains you |
Install jsonlint
to act as syntastic json checker:
$ npm install jsonlint -g
Tell syntatastic about it:
" in your ~/.vimrc
#! /bin/sh | |
### BEGIN INIT INFO | |
# | |
# Source https://raw.github.com/jnstq/rails-nginx-passenger-ubuntu/master/nginx/nginx | |
# | |
# Provides: nginx | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 |
// usage: log('inside coolFunc',this,arguments); | |
// http://paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/ | |
window.log = function(){ | |
log.history = log.history || []; // store logs to an array for reference | |
log.history.push(arguments); | |
if(this.console){ | |
console.log( Array.prototype.slice.call(arguments) ); | |
} | |
}; |
require "rails_helper" | |
describe "news_link/index.html.erb" do | |
context "when there are additional pages" do | |
it "shows the 'Show more' link" do | |
news_links_page = build_news_link_page(has_more_pages: true) | |
render_page(news_links_page) | |
expect(rendered).to have_link('Show More') |
# Kill current session and switch to next | |
tk () { | |
current_session=$(tmux display-message -p '#S') | |
tmux switch-client -n | |
tmux kill-session -t "$current_session" | |
} |
# Use vim keybindings in copy mode | |
setw -g mode-keys vi | |
bind-key -t vi-copy v begin-selection | |
bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy" | |
unbind -t vi-copy Enter | |
bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy" |
#!/usr/bin/env ruby | |
require "fitgem" | |
require "pp" | |
require "yaml" | |
config_file = begin | |
File.open(".fitgem.yml") | |
rescue Object => e | |
puts 'No .fitgem.yml config file found' |