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| /* Temporary disable $stdout | |
| ============================ | |
| This method works for Ruby and new sub-processes. | |
| I have seen other techniques on the net which re-assign $stdout with another IO, | |
| but then the sub-processes will still use the old stdout. | |
| */ |
| class User | |
| has_attached_file :photo, | |
| :processors => [:watermark], | |
| :styles => { | |
| :medium => { | |
| :geometry => "300x300>", | |
| :watermark_path => "#{Rails.root}/public/images/watermark.png" | |
| }, | |
| :thumb => "100x100>", | |
| } |
| AZHU.storage = { | |
| save : function(key, jsonData, expirationMin){ | |
| if (!Modernizr.localstorage){return false;} | |
| var expirationMS = expirationMin * 60 * 1000; | |
| var record = {value: JSON.stringify(jsonData), timestamp: new Date().getTime() + expirationMS} | |
| localStorage.setItem(key, JSON.stringify(record)); | |
| return jsonData; | |
| }, | |
| load : function(key){ | |
| if (!Modernizr.localstorage){return false;} |
| @mixin gradient($first, $second) { | |
| background-color: $second; | |
| -ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#{ie-hex-str($first)}', endColorstr='#{ie-hex-str($second)}');"; | |
| filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#{ie-hex-str($first)}', endColorstr='#{ie-hex-str($second)}');; | |
| zoom: 1; | |
| background: -webkit-gradient(linear, left top, left bottom, from($first), to($second)); | |
| background: -moz-linear-gradient(top, $first, $second); | |
| } |
| #!/usr/bin/env bash | |
| set -o errtrace | |
| set -o errexit | |
| facter_version=$1 | |
| puppet_version=$2 | |
| target_volume=$3 |
| module Sinatra | |
| module Mount | |
| def mount(app, route="/#{app.name.downcase}") | |
| %w{get post put delete patch options}.each do |method| | |
| self.send method.to_sym, "#{route}*" do | |
| app.call( | |
| env.merge!( | |
| 'SCRIPT_NAME' => route.split('/').last, | |
| 'PATH_INFO' => params.delete('splat').join('/') |
| /** | |
| * Like, basically PERFECT scrollbars | |
| */ | |
| /* | |
| It's pure CSS. | |
| Since a quick google search will confirm people going crazy about Mac OS Lion scrollbars... | |
| this has no fade-out effect. | |
| In Mac OS Lion, the lowest common denominator is always showing scrollbars by a setting. |
| // Maintain ratio mixin. Great for responsive grids, or videos. | |
| // https://gist.github.com/brianmcallister/2932463 | |
| // | |
| // $ratio - Ratio the element needs to maintain. | |
| // | |
| // Examples | |
| // | |
| // // A 16:9 ratio would look like this: | |
| // .element { | |
| // @include maintain-ratio(16 9); |
| require 'sinatra/base' | |
| module Sinatra | |
| module Mount | |
| def mount(app, route="/#{app.name.downcase}") | |
| before "#{route}*" do | |
| halt app.call( | |
| env.merge( | |
| 'SCRIPT_NAME' => route.split('/').last, |