Skip to content

Instantly share code, notes, and snippets.

View Duder-onomy's full-sized avatar
💭
Shred till yer Dead

Greg Larrenaga Duder-onomy

💭
Shred till yer Dead
View GitHub Profile
@Duder-onomy
Duder-onomy / creditCardType.js
Created May 26, 2015 22:22
Determine Credit Card Type from Credit Card number. AMD compliant. Basically a refactor of the braintree npm.
define(['lodash'], function(_) {
'use strict';
return function getCardType(cardNumber) {
var key, value, noMatch = {}, types = _getPossibleCCTypes();
if (!_.isString(cardNumber)) { return noMatch; }
for (key in types) {
if (!types.hasOwnProperty(key)) { continue; }
@Duder-onomy
Duder-onomy / gist:f94e84c5d26cc720cee2
Created May 14, 2015 21:57
Start Case Rivets Formatter
model.someUpperCaseMultiWordString = 'the ONE and ONLY';
<div rv-text='model.someUpperCaseMultiWordString | startCase'></div>

The Binder :

@Duder-onomy
Duder-onomy / imageLoader.js
Last active August 29, 2015 14:20
Async Image Preloader Using Promises AMD
define(['jquery'], function($) {
'use strict';
return function(urlArray) {
return $.when.apply($, urlArray.map(function(url) {
if(url) {
var $imgDeferred = new $.Deferred();
setTimeout(function() {
var imageTag = new Image();
@Duder-onomy
Duder-onomy / gist:c6ebaef590e876ad546d
Last active August 29, 2015 14:19
Revealing Module Pattern
define([], function() {

    return {
        play : play,
        stop : stop,
        pause : pause,
        rewind : rewind,
        fastForward : fastForward
 };
@Duder-onomy
Duder-onomy / gist:954d9308a56fac3566d6
Created March 13, 2015 17:35
Javascript Reserved Words.
Reserved keywords as of ECMAScript 6
break
case
class
catch
const
continue
debugger
default
@Duder-onomy
Duder-onomy / .jshintrc
Created March 9, 2015 21:06
Js Hint RC
{
"node": true,
"curly": true,
"globals": {
"define": false,
"describe": false,
"before": false,
"after": false,
"it": false,
"beforeEach": false,
@Duder-onomy
Duder-onomy / put_some_grass_on_it
Created June 27, 2013 20:14
Grass across the bottom sublime snippet.
<snippet>
<content><![CDATA[
***** Add a footer to the bottom of your page ********
<footer></footer>
******You might need to change the 'download' text in the following URL with 'view'
footer {
background-image: url('https://drive.google.com/uc?export=download&id=0B5dCmuP_S1lBdlFoQ1RWaFNqQXc');
background-position: bottom;
background-repeat: repeat-x;