Skip to content

Instantly share code, notes, and snippets.

View tubalmartin's full-sized avatar

Túbal Martín tubalmartin

  • Expedia Group
  • Madrid, SPAIN
  • 22:56 (UTC +02:00)
View GitHub Profile
@mxriverlynn
mxriverlynn / createObject.js
Created October 26, 2012 14:30
An Object.create wrapper / shim for MarionetteJS
// Helpers
// -------
// For slicing `arguments` in functions
var slice = Array.prototype.slice;
// Borrow the Backbone `extend` method so we can use it as needed
Marionette.extend = Backbone.Model.extend;
// A wrapper / shim for `Object.create`. Uses native `Object.create`
@tubalmartin
tubalmartin / ms.js
Created March 8, 2012 00:25 — forked from rauchg/ms.md
Milliseconds conversion utility.
/**
# ms.js
No more painful `setTimeout(fn, 60 * 4 * 3 * 2 * 1 * Infinity * NaN * '☃')`.
ms('2d') // 172800000
ms('1.5h') // 5400000
ms('1h') // 3600000
ms('1m') // 60000
//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Created: 2010/12/05
// Updated: 2018/09/12
// License: MIT
//
// Copyright (c) 2010-2018 Diego Perini (http://www.iport.it)
//