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 queue() { | |
queue.stack = queue.stack || []; | |
var push = function(scope, obj) { Array.prototype.push.call(scope, obj); } | |
if (arguments.length) { | |
queue.stack.push(arguments); | |
if (queue.process) return false; | |
} | |
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 fib (step) { | |
fib.times = fib.times || 0; | |
fib.times += step || 1; | |
clearTimeout(fib.calculate); | |
fib.calculate = setTimeout(function() { | |
var first = 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
#!/usr/bin/env ruby | |
errors = false | |
# Create a simple line break | |
puts "" | |
# Now let's get a list of the changed files that have been staged | |
changed_files = `git diff --staged --name-only HEAD`.split("\n") |
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
$("button").click(function(){ | |
$("#container").load('demo_ajax_load.txt #container'); | |
}); |
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
# Compass Configuration File | |
http_path = "/" | |
css_dir = "." | |
sass_dir = "sass" | |
images_dir = "img" | |
javascripts_dir = "js" | |
output_style = :compressed | |
line_comments = false |
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
mogrify -thumbnail x400 -resize '400x<' -resize 50% -gravity center -crop 200x200+0+0 +repage -format jpg -quality 91 *.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
// Just a nice feature, returns another selector in the absence of | |
// a current one | |
jQuery.fn.or = function(s) { | |
return $(this).length? $(this) : $(s); | |
}; | |
// Example: | |
$(".current").or("ul.gallery li:first-child").fadeIn(); |
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 request = require('request'), | |
yahoo = require("../config/yahoo_key.json"), | |
qs = require('querystring'); | |
function placefinder(string, callback) { | |
var base = "http://where.yahooapis.com/geocode?", | |
data = qs.stringify({ | |
q : escape(string), | |
appid : yahoo.appid, |
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
// Implementation | |
// -------------------------------------------------- // | |
function assert(condition, opt_message) { | |
'use strict'; | |
if (!condition) { | |
var msg = 'Assertion failed'; | |
if (opt_message) { | |
msg = msg + ': ' + opt_message; |
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
require 'spree_core' | |
require 'spree_sample' unless Rails.env == 'production' | |
# All of the magic happens at the line "if Rails.version >= 3.1 ... " | |
# found in spree_variant_options/lib/spree_variant_options.rb | |
module SpreeVariantOptions | |
class Engine < Rails::Engine | |