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
module.exports = { | |
io: null, | |
socket: null, | |
createReactiveMethod: function() {}, | |
initialize: function(server) { | |
console.log("initialized!"); | |
this.io = require('socket.io').listen(server); | |
var that = this; |
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
var UserCollection = require("../dataSources/user") | |
var User = { | |
find: function( name, skypeName, callback ) { | |
if ( skypeName ) { | |
findBySkypeName( name, callback ); | |
} | |
// The rest of your logic there | |
} | |
} |
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
// Assume errorPage, jsonBody, formBody exist within scope. | |
function methods(routes, handleHttpForms) { | |
if (handleHttpForms) { | |
return createHttpFormsRequestHandler(routes) | |
} | |
return requestHandler.bind(this) | |
} | |
function requestHandler(req, res) { |
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
/** | |
* A little script that will screw up people using campaigns on Google | |
* Analytics. | |
* | |
* Do. Not. Use. | |
* | |
* I am not responsible for any action that people may employ using this | |
* little script. It was done purely out of curiosity. | |
* | |
* Usage: |
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
var ncore = require( 'ncore' ); | |
ncore.constructor( { | |
"./other.js": { | |
"test": "./test.js" | |
} | |
}); | |
console.log( ncore ); |
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
// Untested, off-the-cuff | |
$.fn.secondClick = function(handler) | |
{ | |
if ( !$( this ).data( 'click' ) ) { | |
$( this ).data( 'click', 1 ); | |
} | |
else if ( $( this ).data( 'click' ) === 1 ) { | |
handler(); | |
$( this ).data( 'click', '' ); | |
} |
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
var test = require('test.json'); | |
test.some; // "property" |
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
if (!Node.prototype.matchesSelector) { | |
Node.prototype.matchesSelector = function(selector) { | |
return this === document.querySelector(selector); | |
}; | |
} | |
function closest(selector, el) { | |
if (el.parentNode.matchesSelector(selector)) { | |
return el.parentNode; | |
} |
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
session.screen0.clientMenu.usePixmap: true | |
session.screen0.tab.placement: TopLeft | |
session.screen0.tab.width: 64 | |
session.screen0.menu.alpha: 255 | |
session.screen0.tabs.usePixmap: true | |
session.screen0.tabs.maxOver: false | |
session.screen0.tabs.intitlebar: true | |
session.screen0.iconbar.iconTextPadding: 10 | |
session.screen0.iconbar.usePixmap: true | |
session.screen0.iconbar.iconWidth: 128 |
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
var divs = document.getElementsByTagName('div'); | |
({}).toString.apply(divs); | |
// Firefox: "[object HTMLCollection]" | |
// Chrome/Safari: "[object NodeList]" |
OlderNewer