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
:: Installation | |
:: ------------ | |
:: | |
:: 1. Add this to the same directory as the Google Closure Compiler jar | |
:: 2. Add that directory to your Windows PATH environment variable | |
:: | |
:: Then simply run the compiler, for example: | |
:: | |
:: compiler --js input.js --js_output_file output.min.js | |
:: |
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
/* | |
* SyncUrlProtocol - Underscore/Lodash mixin for sync url protocol with window url protocol | |
* | |
* Copyright (c) 2013 Antonio Rodríguez Ruiz | |
* | |
* Licensed under the MIT license: | |
* http://www.opensource.org/licenses/mit-license.php | |
* | |
* Project home: | |
* http://outbook.es |
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
/* | |
* GetChildrenTextNodes - jQuery plugin for children text nodes | |
* | |
* Copyright (c) 2013 Antonio Rodríguez Ruiz | |
* | |
* Licensed under the MIT license: | |
* http://www.opensource.org/licenses/mit-license.php | |
* | |
* Project home: | |
* http://outbook.es |
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
/* | |
* SliceAnchor - jQuery plugin for fake anchors | |
* | |
* Copyright (c) 2012 Antonio Rodríguez Ruiz | |
* | |
* Licensed under the MIT license: | |
* http://www.opensource.org/licenses/mit-license.php | |
* | |
* Project home: | |
* http://outbook.es |
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
// Boring | |
if (isThisAwesome) { | |
alert('yes'); // it's not | |
} | |
// Awesome | |
isThisAwesome && alert('yes'); | |
// Also cool for guarding your code | |
var aCoolFunction = undefined; |
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
#! /bin/sh | |
# ------------------------------------------------------------------------------ | |
# SOME INFOS : fairly standard (debian) init script. | |
# Note that node doesn't create a PID file (hence --make-pidfile) | |
# has to be run in the background (hence --background) | |
# and NOT as root (hence --chuid) | |
# | |
# MORE INFOS : INIT SCRIPT http://www.debian.org/doc/debian-policy/ch-opersys.html#s-sysvinit | |
# INIT-INFO RULES http://wiki.debian.org/LSBInitScripts | |
# INSTALL/REMOVE http://www.debian-administration.org/articles/28 |
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
<?php | |
/* | |
* SliceTemplate - Execute PHP template from file and return the result as a string | |
* | |
* Copyright (c) 2013 Antonio Rodríguez Ruiz | |
* | |
* Licensed under the MIT license: | |
* http://www.opensource.org/licenses/mit-license.php | |
* | |
* Project home: |
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 isLeapYear(year) { | |
return ((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0); | |
} |
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
removeView = function(view) { | |
view.undelegateEvents(); | |
view.$el.empty().off(); | |
view.unbind(); | |
} |
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
<p role="link" tabindex="0" data-link>Link by role</p> | |
<p role="button" tabindex="0" data-button>Button by role</p> | |
<script> | |
const EVENT_CLICK = 'click'; | |
const EVENT_KEYBOARD = 'keypress'; | |
const EVENTS_CLICK = [EVENT_CLICK, EVENT_KEYBOARD]; | |
const KEY_ENTER = 13; | |
const KEY_ESPACE = 32; | |
const KEYS_BUTTON = [KEY_ENTER, KEY_ESPACE]; |