Skip to content

Instantly share code, notes, and snippets.

// Version: v1.0.0-pre.2-291-g4785901
// Last commit: 4785901 (2013-01-05 18:57:16 +0100)
(function() {
/*global __fail__*/
/**
Ember Debug
// Version: v1.0.0-pre.2-291-g4785901
// Last commit: 4785901 (2013-01-05 18:57:16 +0100)
(function() {
/*global __fail__*/
/**
Ember Debug
@mansona
mansona / statusCodes.js
Created December 4, 2012 11:57
Mocha Zombie exception thrown on 401 status code
var expect = require('expect.js'),
Browser = require('zombie');
var browser = new Browser({waitDuration: 1500});
describe('Status Codes', function(){
this.timeout(2000);
it('Unauthorized', function(done){
@mansona
mansona / app.js
Created December 3, 2012 17:15
Zombie Basic Example
var zombie = require("zombie");
var assert = require("assert");
zombie.debug = true;
var browser = new zombie();
browser.visit("http://google.com/")
.then(function(){
assert.equal(browser.statusCode, 401);
@mansona
mansona / parseDuration.js
Created August 22, 2011 13:50 — forked from sj26/parseDuration.js
Parses a natural duration string into seconds.
// Try to be as sensible as possible about parsing durations
function parseDuration(duration) {
// .75
if (match = /^\.\d+$/.exec(duration)) {
return parseFloat("0" + match[0]) * 3600;
// 4 or 11.75
} else if (match = /^\d+(?:\.\d+)?$/.exec(duration)) {
return parseFloat(match[0]) * 3600;
// 01:34
} else if (match = /^(\d+):(\d+)$/.exec(duration)) {