Skip to content

Instantly share code, notes, and snippets.

Michael Cox michaelcox

Block or report user

Report or block michaelcox

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:28dcf784f28c73a03eceb69afa9893a7
Verifying that "" is my Blockstack ID.

Keybase proof

I hereby claim:

  • I am michaelcox on github.
  • I am mdcox ( on keybase.
  • I have a public key whose fingerprint is FFD1 0A59 BEC1 CC64 2BC3 549E F5AA 5B80 1E3C 847A

To claim this, I am signing this object:

View app.ts
import {Component, bootstrap, FORM_DIRECTIVES, CORE_DIRECTIVES} from 'angular2/angular2';
import {HeroList} from './hero-list.component';
import {Hero} from './hero';
selector: 'my-app',
michaelcox / collections.js
Last active Aug 29, 2015
Backbone Unit Testing
View collections.js
define(function(require) {
var Backbone = require('backbone');
var _ = require('underscore');
var models = require('./models');
var collections = {};
collections.Posts = Backbone.Collection.extend({
model: models.Post,
class view extends Backbone.View
initialize: =>
@template = _.template($('#mytemplate').html())
render: =>
@$el.html @template(
model: @model.toJSON()
michaelcox / fnFakeRowspan.js
Created Nov 27, 2012
Uses HTML data attributes to set rowspan in
View fnFakeRowspan.js
$.fn.dataTableExt.oApi.fnFakeRowspan = function (oSettings) {
_.each(oSettings.aoData, function(oData) {
var cellsToRemove = [];
for (var iColumn = 0; iColumn < oData.nTr.childNodes.length; iColumn++) {
var cell = oData.nTr.childNodes[iColumn];
var rowspan = $(cell).data('rowspan');
var hide = $(cell).data('hide');
if (hide) {
michaelcox / SpecRunner.js
Last active Sep 30, 2019
Browser Unit Testing with Backbone Mocha Chai and RequireJS
View SpecRunner.js
baseUrl: '/backbone-tests/',
paths: {
'jquery' : '/app/libs/jquery',
'underscore' : '/app/libs/underscore',
'backbone' : '/app/libs/backbone',
'mocha' : 'libs/mocha',
'chai' : 'libs/chai',
'chai-jquery' : 'libs/chai-jquery',
'models' : '/app/models'
View post-receive
GIT_WORK_TREE=/var/www/ git checkout -f
michaelcox / xdr.js
Created May 10, 2012
Adds XDomainRequest IE CORS support to jQuery
View xdr.js
// Based on
(function( jQuery ) {
if ( window.XDomainRequest && ! ) {
jQuery.ajaxTransport(function( s ) {
if ( s.crossDomain && s.async ) {
if ( s.timeout ) {
s.xdrTimeout = s.timeout;
delete s.timeout;
michaelcox / email.js
Created May 3, 2012
Command Line nodejs App For Sending Test Emails
View email.js
#!/usr/bin/env node
var program = require('commander');
var email = require("mailer");
.option('-s, --subject <text>', 'subject line of email')
.option('-b, --body <text>', 'body area of email')
.option('-r, --recipient <email>', "recipient's email address")
You can’t perform that action at this time.