View _curl-effect.scss
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
/* Stupid compass box-shadow mixin doesn't support multiple shadows... */ | |
@mixin box-shadow-2($first, $second) { | |
$full: $first, $second; | |
@include experimental(box-shadow, $full, -moz, -webkit, -o, not -ms, not -khtml, official); | |
} | |
@mixin curl-effect-shadow($corner) { | |
z-index: -1; | |
position: absolute; |
View gmail-backup
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
#!/bin/bash | |
/usr/bin/offlineimap -u Noninteractive.Quiet | |
cd "$HOME/gmail" | |
test -z "$(git status -s)" && exit | |
git ls-files --deleted -z | xargs -0 git rm --cached | |
git ls-files --modified --others -z | xargs -0 git update-index --add | |
git commit --quiet -m "..." |
View gist:925159
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
# begin | |
# if lock = Lock.acquire('indexing') | |
# ... | |
# end | |
# ensure | |
# lock.release if lock | |
# end | |
# Host: MacBook 2.4GHz Core 2 Duo |
View gist:925165
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
class CreateLocksTable < ActiveRecord::Migration | |
def self.up | |
create_table :locks, :id => false do |t| | |
t.string :name | |
t.string :owner | |
t.datetime :time | |
end | |
add_index :locks, :name | |
end |
View brace-expansion.coffee
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
{ _ } = require 'underscore' | |
assert = require 'assert' | |
expand = (path) -> | |
tokens = _.compact path.split /({|}|,)/ | |
merge = (array, element) -> | |
(el + element) for el in array |
View git-clear-whitespace
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
#!/bin/sh | |
for FILE in `exec git diff --name-only "$1" --`; do | |
sed -E -i '' 's/[[:space:]]*$//' "$FILE" | |
done |
View unit.coffee
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
class Unit | |
@create: (options) -> | |
# This is the object which will hold the private data. | |
privData = {} | |
# We create a new unit and pass it the privData object. | |
unit = new Unit privData, options | |
# Wrap all methods and pass privData as the first argument. This incurs |
View sendmail.js
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 spawn = require('child_process').spawn; | |
exports.send = function(email, config, callback) { | |
var path = typeof config === "string" ? config : "sendmail"; | |
// Spawn sendmail. When it exits invoke the callback. | |
child = spawn(path, [ '-t' ]); | |
child.on('exit', function(code, signal) { | |
if (code !== 0) { | |
callback && callback(code, null); |
View mail-archiver.rb
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 ruby | |
require 'pathname' | |
require 'mail' | |
class Archiver | |
attr_reader :maildir, :time | |
def initialize(maildir) | |
@maildir = maildir |