Skip to content

Instantly share code, notes, and snippets.

View c4urself's full-sized avatar

Christian Verkerk c4urself

  • Tubular Labs
  • Mountain View
View GitHub Profile
@c4urself
c4urself / terraform.sh
Created September 28, 2016 20:50
Wrapper around Terraform
#!/bin/sh
set -e
TERRAFORM_BUCKET_REGION='us-east-1'
TERRAFORM_BUCKET_NAME=''
TERRAFORM_VERSION="0.7.4"
actions="plan apply fmt plan-destroy destroy refresh graph validate"
@c4urself
c4urself / mocha_jslint_happy.js
Created January 3, 2013 18:17
Chai doesn't play nice with JS Lint's check for incorrect use of `false` and `true` -- a setting that cannot be turned off via JS Lint options. The addition of `_true` and `_false` properties to Chai fixes this making JS Lint work correctly.
// We're providing some convenience functions here as well as making sure
// chai tests don't fall on jshint errors by remapping true/false properties
chai.Assertion.addProperty('_true', function () {
this.assert(
true === this.__flags.object,
'expected #{this} to be true',
'expected #{this} to be false',
this.negate ? false : true
);
});
@c4urself
c4urself / films.md
Created November 21, 2012 00:11
Films
@tbranyen
tbranyen / backbone.collectioncache.js
Created June 4, 2012 06:37
Backbone.Collection caching by URL
/*!
* backbone.collectioncache.js v0.0.2
* Copyright 2012, Tim Branyen (@tbranyen)
* backbone.collectioncache.js may be freely distributed under the MIT license.
*/
(function(window) {
"use strict";
// Dependencies
@TooTallNate
TooTallNate / emitLines.js
Created February 10, 2012 01:11
Make any ReadableStream emit "line" events
/**
* A quick little thingy that takes a Stream instance and makes
* it emit 'line' events when a newline is encountered.
*
* Usage:
* ‾‾‾‾‾
* emitLines(process.stdin)
* process.stdin.resume()
* process.stdin.setEncoding('utf8')
* process.stdin.on('line', function (line) {
@p01
p01 / LICENSE.txt
Last active March 9, 2024 13:40 — forked from 140bytes/LICENSE.txt
Sudoku Solver in 140bytes
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Mathieu 'p01' Henri - http://www.p01.org/releases/
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@c4urself
c4urself / ccarousel.py
Created May 10, 2011 13:42
Simple jQuery Click Carousel
// szs Shizzle JS Selector
ccarousel.init = function(szsItems, szsButtonPrev, szsButtonNext) {
var numVisible = 4;
var aAllItems = $(szsItems);
renewList = function() {
aAllItems = $(szsItems);
};
aItems = $(szsItems);
oLeft = $(szsButtonPrev);
@HenrikJoreteg
HenrikJoreteg / straight_include.py
Created December 15, 2010 16:06
A Django Template tag for including files that you don't want to parse as templates
"""
Straight Include template tag by @HenrikJoreteg
Django templates don't give us any way to escape template tags.
So if you ever need to include client side templates for ICanHaz.js (or anything else that
may confuse django's templating engine) You can is this little snippet.
Just use it as you would a normal {% include %} tag. It just won't process the included text.
"""
jQuery templates use constructs like:
{{if condition}} print something{{/if}}
This, of course, completely screws up Django templates,
because Django thinks {{ and }} mean something.
Wrap {% verbatim %} and {% endverbatim %} around those
blocks of jQuery templates and this will try its best