Skip to content

Instantly share code, notes, and snippets.

View danheberden's full-sized avatar

Dan Heberden danheberden

View GitHub Profile
var http = require('http');
var static = require('node-static');
grunt.registerTask( 'server', "Create a preview server", function( port ) {
var done = this.async();
port = port || 8080;
var fileServer = new static.Server('./');
@danheberden
danheberden / bug_report.js
Created December 26, 2012 16:30
Problem with .then in underscore.deferred?
var Deferred = require( 'underscore.deferred' );
// using then won't throw any exceptions
var d1 = Deferred.Deferred();
d1.then( function( a ) {
console.log( 'success', a );
missing_var.destruction;
});
d1.resolve( 'test' );
@danheberden
danheberden / everything.md
Last active January 4, 2024 08:38
Mozilla FirefoxOS notes

FirefoxOS, B2G, gaia and YOU

Getting setup for work on gaia

Overview

FirefoxOS (or B2G - Boot To Gecko) is comprised of three core pieces. Gonk, Gaia and Gecko.

Gonk is the core of the OS, consisting of a linux kernel and HAL layer (parts of which are shared with android for things like Camera, GPS, etc).

success: function(data) {
if(data == 'error') {
} else {
var span = $('<span class="label label-success"><strong>Success</strong></span>');
$this.closest('tr').find('td').first().append( span );
// after 3 seconds...
setTimeout(function(){
// hide the span, once that's done, remove it
span.hide( 'normal', function() {
13:21 danheberden: distilled my ideas into a gist https://gist.github.com/danheberden/279afd863b3144a64885
13:22 kevva`off is now known as kevva
13:23 ccverg has left ()
13:24 satazor has joined (~satazor@a213-22-2-212.cpe.netcabo.pt)
13:28 zz_luisbug is now known as luisbug
13:32 marcooliveira: brb
13:32 marcooliveira has left IRC (Remote host closed the connection)
13:33 wibblymat_ has left IRC (Ping timeout: 256 seconds)
13:44 paulmillar has joined (4d789b64@gateway/web/freenode/ip.77.120.155.100)
13:49 addyosmani: bowerrrr powerrr.
@danheberden
danheberden / jqtotals.js
Last active December 20, 2015 21:09
get eventbrite totals
var sales = {training: 0, conf: 0, team: 0, speaker: 0};
jQuery('#ticketsSalesDiv tr').each(function(i, tr) {
var row = jQuery(tr);
var columns = row.find('td');
var fields = [];
columns.each(function(i, td) {
var column = jQuery(td);
if(i < 1) {
jQuery.each(sales, function(k, v) {
var reg = new RegExp(k, 'i');