Skip to content

Instantly share code, notes, and snippets.

View callumlocke's full-sized avatar

Callum Locke callumlocke

View GitHub Profile
@callumlocke
callumlocke / test.html
Created December 15, 2011 15:46 — forked from aflatter/test.html
Webkit transitions on a newly attached element don't work. Probably related to http://code.google.com/p/chromium/issues/detail?id=82500
<html>
<head>
<title>Test</title>
<style type="text/css">
div {
position: absolute;
height: 200px;
}
.slide {
@callumlocke
callumlocke / new_bashrc.sh
Created August 13, 2012 09:52 — forked from josephwecker/new_bashrc.sh
Replace .bashrc, .bash_profile, .profile, etc. with something much more clean, consistent, and meaningful. Now a repo: https://github.com/josephwecker/bashrc_dispatch
#!/bin/bash
# License: Public Domain.
# Author: Joseph Wecker, 2012
#
# -- DEPRICATED --
# This gist is slow and is missing .bashrc_once
# Use the one in the repo instead! https://github.com/josephwecker/bashrc_dispatch
# (Thanks gioele)
#
# Are you tired of trying to remember what .bashrc does vs .bash_profile vs .profile?
@callumlocke
callumlocke / jquery-1.7-externs.js
Created September 14, 2012 12:12
jQuery 1.7 externs file for Google Closure Compiler
/*
* Copyright 2011 The Closure Compiler Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@callumlocke
callumlocke / rAF.js
Created February 8, 2013 16:44 — forked from paulirish/rAF.js
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller
// fixes from Paul Irish and Tino Zijdel
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
$ grunt
Running "jshint:all" (jshint) task
>> 2 files lint free.
Running "clean:server" (clean) task
Running "coffee:dist" (coffee) task
File .tmp/scripts/hello.js created.
Running "coffee:test" (coffee) task
@callumlocke
callumlocke / job.sh
Last active December 18, 2015 21:39 — forked from kavanagh/job.sh
function job() {
if [[ -z "$1" ]]; then
echo "You must specify a project name!"
return;
fi
mkdir $1 && cd $1 \
&& yo ig-job \
&& subl . && subl ./app/scripts/main.js && subl ./app/scripts/config.js \
&& osascript -e 'tell application "Terminal" to activate' \
-e 'tell application "System Events" to tell process "Terminal" to keystroke "t" using command down' \
@callumlocke
callumlocke / README.md
Last active December 19, 2015 00:09
Mocha Spec Runner Spec

Mocha Spec Runner Spec

This is a spec to verify that your Mocha Spec Runner page can actually load all its script tags.

Paste it into your Spec Runner page as an inline script, just before mocha.run();.

Why?

If one of your source scripts fails to load (e.g. due to a malformed URL), you usually don't get any error message. This can cause confusing test failures that are hard to debug.

@callumlocke
callumlocke / .bowerrc
Last active December 24, 2015 11:49
Helper function to get the spreadsheet key from a URL in FT IG projects.
{
"directory": "bower_components",
"json": "bower.json"
}
@callumlocke
callumlocke / item.rb
Created October 18, 2013 11:50 — forked from Darep/item.rb
# app/models/item.rb
require 'concerns/sortable'
class Item < ActiveRecord::Base
include Sortable
attr_accessible :title
end
@callumlocke
callumlocke / modernizr-track-element-test.js
Last active December 30, 2015 03:19
Modernizr test for "track" element (part of HTML5 video element, for captions/subtitles etc)
Modernizr.addTest('track', function () {
var t = document.createElement('track');
return t.track && t.track.kind;
});