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 handle ( err, res ) { | |
| if ( err ) return console.warn( err ); | |
| // do stuff | |
| } | |
| $.ajax({ | |
| url : '/someurl.json', | |
| // partial ftw - context first argument | |
| // V V | |
| success: handle.bind( null, null ), |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 MongoClient = require( 'mongodb' ).MongoClient | |
| module.exports = function( url ) { | |
| var db; | |
| MongoClient.connect( url, function(err, db) { | |
| if(err) throw err; | |
| db = db | |
| }); | |
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
| npm install git-activity stream-json-clipboard -g && echo '\r\n# Jacob is awesome \r\n\r\n alias copy-whatididtoday="git-activity --json --me | stream-json-clipboard -k message --humanize -p \'- \'"' >> ~/.bash_profile |
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
| FROM ubuntu:14.04 | |
| # updating and upgrading --------------------------------------------- | |
| RUN apt-get update | |
| # Installs deps ------------------------------------------------------ | |
| RUN apt-get install -y build-essential openssl libssl-dev pkg-config monit wget libbz2-dev | |
| # Install Python 2 --------------------------------------------------- | |
| RUN wget http://python.org/ftp/python/2.7.5/Python-2.7.5.tgz |
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
| where:(properties["quizId"] == "544ad7a55b824b035018935e") and ((properties["questionId"] == "544ad7acbd58027a597b7870")or not defined (properties["questionId"])) |
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
| window.addEventListener( 'click', function( e ) { | |
| var href = e.target.href; | |
| // this makes the xhr call | |
| trackEvent( 'link exit', e, function( err, res ) { | |
| window.location = href; | |
| } ); | |
| } ); |
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
| window.addEventListener( 'click', function( e ) { | |
| if ( e.tracked ) return; | |
| var mockEvent = new e.constructor( e.type, e ); | |
| mockEvent.tracked = true; | |
| trackEvent( 'link exit', e, function( err, res ) { | |
| e.target.dispatchEvent( mockEvent ); | |
| } ); |
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
| window.addEventListener( 'click', function( e ) { | |
| // this means the click has already been canceled | |
| if (e.defaultPrevented) return; | |
| // ensure link | |
| var el = e.target, | |
| origin, | |
| mockEvent, | |
| dispathed; |
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 raf = require('raf') // requestAnimationFrame polyfill | |
| var Isomer = require('isomer') // 3ds | |
| var ease = require('ease-component') // easing | |
| // duration of loop / speed of animation | |
| var duration = 2000 | |
| // create a canvas element and add it to the page | |
| var canvas = document.createElement('canvas') | |
| var ctx = canvas.getContext('2d') |
OlderNewer