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 () { | |
var selector = window.prompt("Enter a selector to highlight", "a, .gl, a span"), | |
els = document.querySelectorAll(selector), | |
el; | |
for each (el in els) { | |
if (el.style) el.style.backgroundColor = "rgba(255,0,0,0.5)"; | |
} | |
}()); |
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 placeholders = function () { | |
var body = $(document.body), | |
inputs = $("label.ui_placeholder").map(function () { | |
var label = $(this), | |
input = $("#" + label.attr("for")); | |
if (input.val()) { | |
label.hide(); | |
} | |
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> | |
<script type="text/javascript" src="raphael.js"></script> | |
<style> | |
div { | |
/* border: 1px solid #ccc;*/ | |
} | |
</style> | |
</head> |
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 'nanoc3/tasks' | |
require 'rubygems' | |
def rebuild_site(relative) | |
begin | |
puts ">>> Change Detected to: #{relative} >> Update Complete " | |
sh 'nanoc co' | |
rescue StandardError => e | |
puts e | |
end |
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
/** | |
* Helper function for passing arrays of promises to $.when | |
*/ | |
jQuery.whenArray = function ( array ) { | |
return jQuery.when.apply( this, array ); | |
}; | |
/** | |
* Accepts a single image src or an array of image srcs. |
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
(new Date("Apr 22 2011 17:00") - new Date("Apr 22 2011 16:01")) / (1000 * 60 * 60) |
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 'rubygems' | |
require 'middleman' | |
middleman_app = Middleman::Server.new | |
protected_middleman = Rack::Auth::Basic.new(middleman_app) do |username, password| | |
[username, password] == ['theuser', 'thepassword'] | |
end | |
run protected_middleman |
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 'rubygems' | |
require 'rack-rewrite' | |
require 'middleman' | |
use Rack::Rewrite do | |
rewrite %r{^/([^\./]+)/?$}, '/$1.html' | |
end | |
run Middleman::Server |
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
if [ -f /usr/local/etc/bash_completion.d/git-completion.bash ]; then | |
source /usr/local/etc/bash_completion.d/git-completion.bash | |
fi | |
alias ls="ls -F" | |
alias l="ls -G" | |
alias la="ls -a" | |
alias ll="ls -al" | |
alias ps="ps -ajx" | |
alias cdd="cd" |
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
if has("autocmd") | |
" Treat '-' as a keyword char in HTML & CSS | |
autocmd InsertEnter *.{html,haml,css,scss,sass,slim} setlocal iskeyword+=- | |
autocmd InsertLeave *.{html,haml,css,scss,sass,slim} setlocal iskeyword-=- | |
endif |
OlderNewer