Skip to content

Instantly share code, notes, and snippets.

View wwilkins's full-sized avatar

Walker Wilkins wwilkins

View GitHub Profile
@wwilkins
wwilkins / backbone-validation-bootstrap.js.coffee
Created October 29, 2012 17:05 — forked from driehle/backbone-validation-bootstrap.js.coffee
Render error messages of Backbone.Validation for Twitter Bootstrap
_.extend Backbone.Validation.callbacks,
valid: (view, attr, selector) ->
control = view.$('[' + selector + '=' + attr + ']')
group = control.parents(".control-group")
group.removeClass("error")
if control.data("error-style") == "tooltip"
# CAUTION: calling tooltip("hide") on an uninitialized tooltip
# causes bootstraps tooltips to crash somehow...
control.tooltip "hide" if control.data("tooltip")
@wwilkins
wwilkins / gist:3875598
Created October 11, 2012 21:31 — forked from brandonb927/image-2x.less
@2x LESS CSS Mixin
I converted the SCSS mixin to LESS for the lazy coders like myself in response to this blog post (http://37signals.com/svn/posts/3271-easy-retina-ready-images-using-scss)
.image-2x(@image, @width, @height) {
@media only screen and (-webkit-min-device-pixel-ratio: 1.3),
only screen and (-o-min-device-pixel-ratio: 3/2),
only screen and (min--moz-device-pixel-ratio: 1.3),
only screen and (min-device-pixel-ratio: 1.3),
only screen and (min-resolution: 1.3dppx) {
/* on retina, use image that's scaled by 2 */
background-image: url('@{image}');
@wwilkins
wwilkins / Gemfile
Created September 13, 2012 14:56
Rails Lightweight Stack. Most of this is detailed on Crafting Rails Applications - http://pragprog.com/book/jvrails/crafting-rails-applications
source :rubygems
# We are not loading Active Record, nor Active Resources etc.
# We can do this in any app by simply replacing the rails gem
# by the parts we want to use.
gem "actionpack", "~> 3.2"
gem "railties", "~> 3.2"
gem "tzinfo"
# Let's use thin
@wwilkins
wwilkins / yoga_for_geeks.md
Created August 28, 2012 13:30
Yoga for Geeks

Yoga for Geeks

Madison Ruby Conf 2012


Yoga: Lauren Amerson

@wwilkins
wwilkins / latency.txt
Created May 31, 2012 18:11 — forked from jboner/latency.txt
Latency numbers every programmer should know
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns
Mutex lock/unlock 25 ns
Main memory reference 100 ns
Compress 1K bytes with Zippy 3,000 ns
Send 2K bytes over 1 Gbps network 20,000 ns
Read 1 MB sequentially from memory 250,000 ns
Round trip within same datacenter 500,000 ns
Disk seek 10,000,000 ns