This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
function printCommitLine(){ | |
local FROM=$1 | |
local TO=$2 | |
if [ TO ]; then | |
git log $GIT_LOG_OPTS --format="$LOG_FORMAT_OPTS" $FROM..$TO | |
else | |
git log $GIT_LOG_OPTS --format="$LOG_FORMAT_OPTS" $FROM | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Benchmark.bmbm do |x| | |
x.report('<<:') do | |
arr = [] | |
50_000.times do |i| | |
arr2 = [i] | |
arr << arr2 | |
end | |
end | |
x.report('+=:') do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(d){ | |
var asin = d.getElementById('ASIN'), url; | |
if (asin) { | |
url = 'http://' + d.domain + '/dp/' + asin.value; | |
if (prompt('Short Amazon URL (hit OK to load):', url)) { | |
window.location.href = url; | |
} | |
} else { | |
alert("Can't find an Amazon product ID."); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# rails_app/lib/tasks/asset_hat_extensions.rake | |
# AssetHat: http://mintdigital.github.com/asset_hat/ | |
namespace :asset_hat_extensions do | |
namespace :css do | |
task :fix_media_queries do | |
# The `cssmin` gem has a bug in which it shortens | |
# `@media screen and (max-width:800px)` to | |
# `@media screen and(max-width:800px)` -- the missing space breaks it. | |
# This task re-adds the space. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Detect whether the browser supports `box-shadow: inset [...]`: | |
(function(e,s,k,u){s=e[s];s[k]=s[k]==u?0:'inset 0 0 0 red';return!!s[k]}(document.createElement('test'),'style','webkitBoxShadow')); | |
// Replace `webkitBoxShadow` as needed, e.g., `MozBoxShadow`. | |
// For use when Modernizr doesn't provide such fine-grained coverage: | |
// https://github.com/Modernizr/Modernizr/issues/109 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rehearsal ---------------------------------------------- | |
#one? 0.000000 0.000000 0.000000 ( 0.001843) | |
#one? 0.000000 0.000000 0.000000 ( 0.002105) | |
#kind.one? 0.010000 0.000000 0.010000 ( 0.005502) | |
------------------------------------- total: 0.010000sec | |
user system total real | |
#one? 0.000000 0.000000 0.000000 ( 0.002660) | |
#one? 0.000000 0.000000 0.000000 ( 0.002275) | |
#kind.one? 0.000000 0.000000 0.000000 ( 0.003826) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Useful when Campfire chat images are | |
being used more for noise than signal. | |
To use in Propane, add to | |
~/Library/Application Support/Propane/styles/cf_chat.css | |
and restart the app: | |
*/ | |
table.chat tr.message a.loaded img { | |
max-width: 100px !important; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cdp(){ | |
# For changing directly to a specific project's directory. | |
# Usage: `cdp bloombox` | |
local proj=$1 | |
c "/Users/ron/Documents/Projects/$proj/" | |
settabtitle $proj | |
} | |
_cdp(){ | |
# Tab completion routine for `cdp`: | |
COMPREPLY=() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Carl = (function(){ | |
var C = {}, | |
drops = []; // private | |
C.eavesdrops = function(pattern){ | |
drops.push(pattern); | |
}; | |
return C; | |
}()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html lang="en"> | |
<head> | |
<style> | |
div { | |
position: relative; | |
display: inline-block; | |
margin: 2em; | |
padding: 5em; | |
background: #fcfcfc; | |
background: -webkit-gradient(linear, left top, left bottom, |
NewerOlder