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
<!DOCTYPE html> | |
<html> | |
<head> | |
<style> | |
/* How to select a range of children | |
* (Here, 3rd-7th children, inclusive): | |
*/ | |
ul li:nth-child(n+3):nth-child(-n+7) { | |
outline: 1px solid #0f0; | |
} |
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
/* | |
Gmail bookmarklet | |
rondevera.com | |
For quickly e-mailing the current page's URL (and the selected text, if any) | |
via Gmail. | |
Usage: | |
- Create a new item in your bookmark bar with the name "Gmail" (or just "Gm", | |
or your favorite Unicode character), and the code below as the location. |
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
<style> | |
body { | |
background: #000; | |
} | |
p { | |
margin: 1em auto; | |
background: -webkit-gradient( | |
linear, left top, left bottom, | |
from(#fff), color-stop(50%, #777), color-stop(50%, #666), to(#111)); | |
background: -webkit-linear-gradient(top, #fff, #777 50%, #666 50%, #111); |
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
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
# 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=() |
NewerOlder