Skip to content

Instantly share code, notes, and snippets.

<!-- Raven.js Config -->
<script src="{{ JS_PATH }}/lib/raven.js" type="text/javascript"></script>
<script type="text/javascript">
// Ignore list based off: https://gist.github.com/1878283
var ravenOptions = {
// Will cause a deprecation warning, but the demise of `ignoreErrors` is still under discussion.
// See: https://github.com/getsentry/raven-js/issues/73
ignoreErrors: [
// Random plugins/extensions
'top.GLOBALS',
#!/usr/bin/python
# Adapted from http://kutuma.blogspot.com/2007/08/sending-emails-via-gmail-with-python.html
import getpass
import smtplib
from email.MIMEMultipart import MIMEMultipart
from email.MIMEBase import MIMEBase
from email.MIMEText import MIMEText
from email import Encoders
import os
@there4
there4 / .tmux.conf
Created January 29, 2013 20:37
My TMUX configuration
# See https://github.com/davidbrewer/tmux-conf/blob/master/tmux.conf
# change to the screen hotkey
unbind C-b
unbind l
set-option -g prefix C-a
# Reload key
bind r source-file ~/.tmux.conf
(function(a,b,c){if(c in b&&b[c]){var d,e=a.location,f=/^(a|html)$/i;a.addEventListener("click",function(a){d=a.target;while(!f.test(d.nodeName))d=d.parentNode;"href"in d&&(chref=d.href).replace(e.href,"").indexOf("#")&&(!/^[a-z\+\.\-]+:/i.test(chref)||chref.indexOf(e.protocol+"//"+e.host)===0)&&(a.preventDefault(),e.href=d.href)},!1)}})(document,window.navigator,"standalone");
@there4
there4 / jsonp.js
Created January 5, 2013 15:41
Backbone JSONP Model Abstract.
//
// Backbone JSONP Model Abstract
// =============================================================================
//
// * Author: [Craig Davis]([email protected])
// * Since: 1/4/2013
// -----------------------------------------------------------------------------
//
define([
"jquery",
@there4
there4 / index.jsonp
Created January 5, 2013 15:23
Twig Template to generate JSONP from HiFi. This can be used to fetch blog post data from remote sites. Note that the caller must deliver the name of the callback as 'jsonCallback' as a parameter.
{{hifi.http.get.jsonCallback}}({"title":"{{ this.title|e('js') }}","content":"{{ this.content|e('js') }}"});
@there4
there4 / Catching clicks
Created December 7, 2012 02:29 — forked from anonymous/Catching clicks
Form handler that doesn't work in Firefox
formEvent: function (event) {
console.log(event); // "Not defined!" -- Firefox
eventType = event.target.type;
switch (eventType) {
case "checkbox":
classArray = event.target.classList;
key = classArray[0];
value = classArray[1];
@there4
there4 / jsthb.js
Created December 5, 2012 19:33
GruntJS task for minify, handlebars, and JST compilation
/*global process: true, module: true*/
// JST-HB
//
// Description: Compile handlebars templates to JST file.
//
var fs = require('fs'),
path = require('path'),
Handlebars = require('handlebars'),
_ = require('underscore'),
minify = require('html-minifier');
@there4
there4 / vertebrates.js
Created November 6, 2012 22:03 — forked from jsvine/vertebrates.js
vertebrates.js
var Vertebrate = {};
Vertebrate.Model = Backbone.Model.extend();
Vertebrate.Collection = Backbone.Collection.extend({
model: Vertebrate.Model
});
// Source: http://en.wikipedia.org/wiki/Vertebrates
var vertebrates = new Vertebrate.Collection([
@there4
there4 / mysql_drop_wildcard
Created November 4, 2012 18:37
MySQL drop tables by wildcard
mysqldump -u username -p --add-drop-table --no-data dbname | grep "^DROP.*\`xx_" | mysql -u username -p dbname