This file contains hidden or 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
<div class="one"> </div> | |
<div class="one-alt"> </div> | |
<div class="two"> </div> | |
<div class="two-alt"> </div> | |
<div class="three"> </div> | |
<div class="three-alt"> </div> | |
<div class="four"> </div> | |
<div class="four-alt"> </div> | |
<div class="five"> </div> | |
<div class="five-alt"> </div> |
This file contains hidden or 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/ruby | |
# Script to checkout each revision of a middleman project and take a screenshot. | |
require 'fileutils' | |
commits = `git rev-list master`.split("\n").reverse | |
resolution = '1400x900' | |
url = 'http://127.0.0.1:4567/' | |
step = 20 # Step by this many commits after each screenshot. |
This file contains hidden or 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 distance = function(s1, s2) { | |
var m = 0; | |
// Exit early if either are empty. | |
if ( s1.length === 0 || s2.length === 0 ) { | |
return 0; | |
} | |
// Exit early if they're an exact match. | |
if ( s1 === s2 ) { |
This file contains hidden or 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> | |
<body> | |
<a href="javascript:(function() { | |
var blur = 8, | |
style = 'blur(' + blur + 'px)'; | |
if ( document.body.style.webkitFilter.indexOf(style) === -1 ) { | |
document.body.style.webkitFilter = style; | |
} else { |
This file contains hidden or 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
Array::clone = -> | |
@slice 0 | |
This file contains hidden or 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 difference(s, t) { | |
if ( s === t ) { | |
return 0; | |
} | |
if ( s.length === 0 ) { | |
return s.length; | |
} | |
if ( t.length === 0 ) { |
This file contains hidden or 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 | |
images=$(ls | grep -e '.[jpg|png]$') | |
for image in $images | |
do | |
base=$(basename "$image") | |
name="${base%.*}" | |
echo "Thumbnailing $image..." | |
convert "$image" -thumbnail 140x140^ -gravity center -extent 140x140 "${name}_thumb.jpg" |
This file contains hidden or 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
// Some helpers to generate random testing data; a seeder for javascript. | |
(function() { | |
'use strict'; | |
/////////////////////////////////////////////////////////////////////////// | |
// UTILITIES | |
// Methods for stuff like generating numbers and transforming text. | |
/////////////////////////////////////////////////////////////////////////// | |
var utils = { |
This file contains hidden or 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
String::slugify = -> | |
map = | |
'à':'a' | |
'á':'a' | |
'ä':'a' | |
'â':'a' | |
'è':'e' | |
'é':'e' | |
'ë':'e' | |
'ê':'e' |
This file contains hidden or 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 ( $, window, document, undefined ) { | |
var pluginName = 'dealWithIt', | |
defaults = { | |
speed: 7000 | |
}; | |
function DealWithIt( element, options ) { | |
this.element = element; | |
this.options = $.extend( {}, defaults, options) ; | |
this._defaults = defaults; |