Skip to content

Instantly share code, notes, and snippets.

View dankimio's full-sized avatar
:octocat:

Dan Kim dankimio

:octocat:
View GitHub Profile
@rwz
rwz / gist:3281979
Created August 7, 2012 05:35
Rendering Jbuilder templates from within model
# this is the easiest way to use partials from model I could find so far
class Entry < AR::Base
def as_json
context = ApplicationController.new.view_context
context.render('/api/entries/entry.json', entry: self)
end
end
@saetia
saetia / gist:1623487
Last active August 28, 2026 12:55
Clean Install – OS X 10.11 El Capitan

OS X Preferences


most of these require logout/restart to take effect

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a shorter Delay until key repeat