Skip to content

Instantly share code, notes, and snippets.

" Reload Google Chrome on Mac from Vim.
" Adapted from: https://github.com/gcollazo/BrowserRefresh-Sublime/
function! ChromeReload()
python << EOF
from subprocess import call
browser = """
tell application "Google Chrome" to tell the active tab of its first window
reload
end tell
"""
" Reload Google Chrome on Mac from Vim.
" Adapted from: https://github.com/gcollazo/BrowserRefresh-Sublime/
function! ChromeReload()
python << EOF
from subprocess import call
browser = """
tell application "Google Chrome" to tell the active tab of its first window
reload
end tell
"""
@jondkinney
jondkinney / jondkinney_tabs.vim
Created September 3, 2013 04:00
Vim tab junk
" TABS
" ----
function! MoveCurrentTab(value)
if a:value == 0
return
endif
let move = a:value - 1
let move_to = tabpagenr() + move
if move_to < 0
let move_to = 0
Check out http://rubyonrails.org and there is a big list of resources. Some of my favorites are:
http://railscasts.com/
http://ruby5.envylabs.com/
http://guides.rubyonrails.org/
http://www.rubyinside.com/
If you want to actually get into the dev, follow this - http://ruby.railstutorial.org/
More advanced stuff (TDD / design patterns / refactoring strategies / etc) can be found here: http://destroyallsoftware.com
$ ->
$('#entry_description').simplyCountable()
$(document).on "mouseover", "*[data-zc-copy-value]", ->
that = $(this)
width = that.outerWidth()
height = that.outerHeight()
if that.data("zc-activated") isnt "true"
# init new ZeroClipboard client
:javascript
analytics.identify(#{current_user.id}, {
email: '#{current_user.email}',
name: '#{current_user.display_name}',
company: '#{current_user.company.try(:name)}',
created: '#{current_user.created_at}',
roles: '#{current_user.roles.map(&:name).join(',')}',
accredited_investor: '#{current_user.accredited_investor?}',
pending_accreditation: '#{current_user.pending_accreditation?}',
accepted_terms: '#{current_user.accepted_terms?}',
# config/initializers/pdfkit.rb
PDFKit.configure do |config|
if Rails.env.development?
config.wkhtmltopdf = '/usr/local/bin/wkhtmltopdf'
config.root_url = "http://bolstr.dev" # Use only if your external hostname is unavailable on the server.
elsif Rails.env.test?
config.root_url = "http://bolstr.dev"
if ENV['CI'] == "true"
config.wkhtmltopdf = '/home/ubuntu/bin/wkhtmltopdf'
# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
# It is recommended to regenerate this file in the future when you upgrade to a
# newer version of cucumber-rails. Consider adding your own code to a new file
# instead of editing this one. Cucumber will automatically load all features/**/*.rb
# files.
require 'simplecov'
SimpleCov.start 'rails'
SimpleCov.coverage_dir 'coverage/cucumber'
require 'cucumber/rails'
@jondkinney
jondkinney / gist:5412429
Created April 18, 2013 12:43
Eject all (well, most ;) disks
tell application "Finder" to eject (every disk whose ejectable is true and local volume is true and physical size < 1.0E+9)
# config/initializers/pdfkit.rb
PDFKit.configure do |config|
if Rails.env == 'development'
config.wkhtmltopdf = '/usr/local/bin/wkhtmltopdf'
config.root_url = "http://bolstr.dev" # Use only if your external hostname is unavailable on the server.
elsif Rails.env == 'test'
config.wkhtmltopdf = '/usr/local/bin/wkhtmltopdf'
config.root_url = "http://bolstr.dev"
else
# this is where it's installed on the server