Skip to content

Instantly share code, notes, and snippets.

Jon Kinney jondkinney

Block or report user

Report or block jondkinney

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View vimrc_main
" 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
"""
View vimrc_main
" 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
"""
View jondkinney_tabs.vim
" 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
View gist:6123862
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
View contest.js.coffee
$ ->
$('#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
View application.html.haml
: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?}',
View pdfkit.rb
# 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'
View env.rb
# 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 Apr 18, 2013
Eject all (well, most ;) disks
View gist:5412429
tell application "Finder" to eject (every disk whose ejectable is true and local volume is true and physical size < 1.0E+9)
View pdfkit.rb
# 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
You can’t perform that action at this time.