This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Handlebars.getTemplate = function(name) { | |
if (Handlebars.templates === undefined || Handlebars.templates[name] === undefined) { | |
$.ajax({ | |
url : 'templatesfolder/' + name + '.handlebars', | |
success : function(data) { | |
if (Handlebars.templates === undefined) { | |
Handlebars.templates = {}; | |
} | |
Handlebars.templates[name] = Handlebars.compile(data); | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* | |
* Parent class containing some methods and properties that must be inherited | |
* | |
*/ | |
var ParentClass = Backbone.Model.extend({ | |
initialize: function() { | |
this.set('name','Dear'); | |
}, | |
say_hello: function ( ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Object.getOwnPropertyNames(window.Math).forEach(function (method) { | |
window[method] = Math[method]; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* | |
* Here we will could extend lodash with some custom useful methods | |
* | |
*/ | |
(function (_) { | |
'use strict'; | |
/** | |
* Initialize a new array having a custom length and a custom default value | |
* @param { Number | Object | String } defaultValue: any valid javascript element |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;(function(document, window, undefined) { | |
// wrap always your modules to avoid the namespace pollution | |
// use always the strict statement | |
'use strict'; | |
// you do not need to wrap all your code in an if statement... | |
if (!document.createElement('svg').getAttributeNS) return; | |
// shortcut to select any DOM element | |
var $ = document.querySelectorAll.bind(document), | |
// create an array with all the inputs to uste | |
// BTW I am sure that this solution is neither correct but it comes from the original code logic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rivets.configure({ | |
templateDelimiters: ['{{', '}}'] | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Simple Model class to listen all its status changes | |
*/ | |
(function(root, factory) { | |
if (typeof define === 'function' && define.amd) { | |
// AMD. Register as an anonymous module. | |
define(factory); | |
} else if (typeof exports === 'object') { | |
// Node. Does not work with strict CommonJS, but | |
// only CommonJS-like enviroments that support module.exports, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/usr/bin/env bash | |
# MIT © Sindre Sorhus - sindresorhus.com | |
# forked by Gianluca Guarini | |
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)" | |
check_run() { | |
echo "$changed_files" | grep -E --quiet "$1" && eval "$2" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! | |
* | |
* Author: Gianluca Guarini | |
* Contact: [email protected] | |
* Website: http://www.gianlucaguarini.com/ | |
* Twitter: @gianlucaguarini | |
* | |
* | |
**/ | |
if (navigator.userAgent.match(/iPad;.*CPU.*OS 7_\d/i)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.%cssClass% .ace_gutter { | |
background: #e8e8e8; | |
color: #333; | |
} | |
.%cssClass% .ace_print-margin { | |
width: 1px; | |
background: %printMargin%; | |
} |
OlderNewer