Skip to content

Instantly share code, notes, and snippets.

View esundahl's full-sized avatar

Erik Sundahl esundahl

View GitHub Profile
@travisjeffery
travisjeffery / coffee.snippets
Created May 18, 2011 06:55
Coffee-script Snippets/Snipmate File
snippet bfun
${1:(${2:args}) }=>
${3:# body...}
snippet cla
class ${1:ClassName}${2: extends ${3:Ancestor}}
${4:constructor: (${5:args}) ->
${6:# body...}}
$7
@tbeseda
tbeseda / gist:1096141
Created July 20, 2011 23:05
Cakefile to watch and recursively concat and compile CoffeeScript automatically.
fs = require 'fs'
{exec} = require 'child_process'
util = require 'util'
growl = require 'growl'
appFiles = [
'src/hasToGoFirst.coffee' # put your files that must be loaded in first into the array
'src/notAsImportantButNeedsToGoBeforeTheRest.coffee'
]
@paulirish
paulirish / rAF.js
Last active July 2, 2024 11:59
requestAnimationFrame polyfill
// 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
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
@ruzzbot
ruzzbot / grunt-bbb.js
Created July 31, 2012 03:04
JavaScript Gruntjs script for the backbone boilerplate [JavaScript,Configure,Settings,Backbone,BBB,Grunt,Bundle,Package,Template]
// This is the main application configuration file. It is a Grunt
// configuration file, which you can learn more about here:
// https://github.com/cowboy/grunt/blob/master/docs/configuring.md
module.exports = function(grunt) {
grunt.initConfig({
// The clean task ensures all files are removed from the dist/ directory so
// that no files linger from previous builds.
clean: ["dist/"],
@iros
iros / API.md
Created August 22, 2012 14:42
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

// add s3: {key: '', secret: '', bucket: ''} to component.json
builder.use(s3);
function s3 (b) {
var s3Client;
Builder.prototype.copyTo = function (file, dest, done) {
var s3Dest = dest.replace(b.assetsDest,'');
s3Client = s3Client || knox.createClient(b.conf.s3)
@ianstormtaylor
ianstormtaylor / view.md
Last active December 19, 2015 17:39
View spec.

View

View(model, el, options)

The View's constructor should take an optional model. It should also take an optional el so that the user can use a pre-made element instead of the View creating its own. If necessary, it should take additional options as a dictionary.

For convenience, add an el -> options overload if you add an options argument.

View.template

The View's template should live at .template if one exists so that it can be overriden if need be. The HTML for the view's template is also part of it's spec, so it should be well thought out. Use namespaced class names for child elements to avoid collisions (for example an .integration element's label would be .integration-label).

@tj
tj / example.js
Created July 31, 2013 18:48
console.api()
function params(fn) {
var str = fn.toString();
var sig = str.match(/\(([^)]*)\)/)[1];
if (!sig) return [];
return sig.split(', ');
}
console.api = function(obj){
console.log();
var proto = Object.getPrototypeOf(obj);
@anthonyshort
anthonyshort / style.css
Created November 5, 2013 18:07
Float labels with Reactive: http://mattdsmith.com/float-label-pattern/ Just set the title on the model when
.floatLabel {
transition: all 1s ease-in-out;
position: relative;
}
.floatLabel.hide {
opacity: 0;
top: 3px;
}
lib-cov
*.seed
*.log
*.csv
*.dat
*.out
*.pid
*.gz
*.DS_Store
*.swp