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 callbackCurrier = function(obj, funcName) { | |
var originalFunction = obj[funcName]; | |
var callbackFunc = function() { | |
var args = Array.prototype.slice.call(arguments, 0); | |
var callback = args.pop(); | |
var returnValue = originalFunction.apply(obj, args); | |
if (callback) { | |
callback(returnValue); | |
} | |
}; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script> | |
<script src="http://underscorejs.org/underscore-min.js"></script> | |
<script src="main.js"></script> | |
</head> | |
<body> | |
<div id="quiz-app"></div> | |
<script type="text/template" id="template-question"> |
- CSS Sprites - http://css-tricks.com/css-sprites/
- Put CSS at the top of your page
- Reduce number of HTTP requests
- Use a CDN
- Expires/cache-control header
- Specify character set UTF-8 meta tag
- Minify HTML, CSS, and JS (Grunt!) - https://github.com/gruntjs/grunt-contrib-uglify, https://github.com/gruntjs/grunt-contrib-cssmin, and https://github.com/gruntjs/grunt-contrib-htmlmin
- Concatenate CSS and JS (Grunt!) - https://github.com/gruntjs/grunt-contrib-concat
- Enable GZip compression - http://betterexplained.com/articles/how-to-optimize-your-site-with-gzip-compression/
- Use efficient CSS selectors (mainly, don't use too many) - http://csswizardry.com/2011/09/writing-efficient-css-selectors/
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
<!DOCTYPE html> | |
<html> | |
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script> | |
</html> | |
<body> | |
<button id="scissors">scissors</button> | |
<button id="rock">rock</button> | |
<button id="paper">paper</button> | |
<h1 id="decision">OUTCOME GOES HERE</h1> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<style> | |
.container-one { | |
min-height: 200px; | |
background-color: white; | |
} | |
.container-two { | |
min-height: 200px; |
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 five = require('johnny-five'); | |
var keypress = require('keypress'); | |
var gm = require('gm'); | |
var board = new five.Board(); | |
var fs = require('fs'); | |
var PNG = require('pngjs').PNG; | |
function componentToHex(c) { | |
var hex = c.toString(16); | |
return hex.length == 1 ? "0" + hex : hex; |
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
// Node.js proxy server for CORS requests with single page, no-backend apps. | |
// | |
// Instructions: | |
// 1) Place file into your app directory | |
// 2a) If you don't have a package.json file in this directory, run "npm init" first | |
// 2b) Run "npm install --save express request query-string" | |
// 3) Run server with "node server.js" | |
// 4) Configure Express to use whatever folder you want to serve your site out of. | |
// By default, this will run out of whatever folder you have your server.js in, | |
// but you shouldn't do this since it'll make everything in this folder accessible, |
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
http://mkopas.net/files/conversations/conversations.html | |
http://tarasue.makiyamazaki.com/ | |
http://www.newgrounds.com/portal/view/591565 |
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 cls = []; | |
Array.prototype.slice.call( document.querySelectorAll('*'), 0 ).forEach( function ( el ) { | |
cls = cls.concat( Array.prototype.slice.call( el.classList, 0 ) ); | |
} ); | |
cls = cls.reduce( function ( p, c ) { | |
if ( p.indexOf( c ) < 0 ) p.push( c ); | |
return p; | |
}, [] ); | |
console.log( cls ); |
OlderNewer