This file contains hidden or 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
| #top { | |
| height: 51px; | |
| background: #D1D1D1; | |
| border-bottom: 1px solid #B4B4B4; | |
| } | |
| #section { | |
| min-height: 302px; | |
| border-top: 2px solid #ECECEC; | |
| background-color: #DFDFDF; | |
| background-image: -webkit-gradient(linear, left top, left bottom, from(#DFDFDF), to(#B9B9B9)); |
This file contains hidden or 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
| var ops = +(process.argv[2] || 100) | |
| , start | |
| , ttl | |
| function timeStart(label) { | |
| console.time(label) | |
| start = +new Date | |
| } | |
| function timeEnd(label) { |
This file contains hidden or 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
| var SECOND = 1000 | |
| , MINUTE = 60 * SECOND | |
| , HOUR = 60 * MINUTE | |
| // Delay timer for socket.io reconnections | |
| function time(attempts, delay, limit) { | |
| var i = 0 | |
| , time = 0 | |
| while (i < attempts) { |
This file contains hidden or 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
| 'use strict'; | |
| /*! | |
| * Module dependencies. | |
| */ | |
| var queue = {} | |
| , backs = {} | |
| , tick = process.nextTick | |
| , toString = Object.prototype.toString |
This file contains hidden or 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 hash loader | |
| -- Commands used | |
| -- HGETALL key | |
| -- MULTI | |
| -- EXEC | |
| local SEP = '::' | |
| local FIELD = 'FIELD' .. SEP | |
| local REFERENCE = 'REFERENCE' .. SEP |
This file contains hidden or 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
| -- -------------------------------------------------- | |
| -- https://www.hackerrank.com/challenges/saveprincess | |
| -- -------------------------------------------------- | |
| -- Sample input | |
| -- -------------------------------------------------- | |
| -- 3 | |
| -- --- | |
| -- -m- | |
| -- p-- | |
| -- -------------------------------------------------- |
This file contains hidden or 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
| /** | |
| * Require cache replacement | |
| * | |
| * @param {String} module name | |
| * @param {Any} module replacement | |
| */ | |
| module.exports = function(name, fn) { | |
| var path = require.resolve(name) | |
| , cache = require.cache[path] |
This file contains hidden or 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
| var util = require('util') | |
| , slice = Array.prototype.slice | |
| function inspect() { | |
| slice.call(arguments).forEach(function(arg) { | |
| console.log('\n', util.inspect(arg, false, null, true), '\n') | |
| }) | |
| } | |
| module.exports = inspect |
This file contains hidden or 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() { | |
| 'use strict'; | |
| var root = this | |
| /** | |
| * Backbone modularization | |
| * | |
| * @param {String} module name | |
| * @returns {Object} module container |
This file contains hidden or 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
| /** | |
| * Anchor tag hijacker [tbranyen style] | |
| * | |
| * @param {Object} jquery selector (optional, default $(document)) | |
| */ | |
| Backbone.Router.prototype.hijack = function($el) { | |
| var self = this; | |
| $el = $el || $(document); |