Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
| function Spy (fn) { | |
| if (!fn) fn = function() {}; | |
| function proxy() { | |
| var args = Array.prototype.slice.call(arguments); | |
| proxy.calls.push(args); | |
| proxy.called = true; | |
| fn.apply(this, args); | |
| } |
| // http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
| // http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating | |
| // requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel | |
| // MIT license | |
| (function() { | |
| var lastTime = 0; | |
| var vendors = ['ms', 'moz', 'webkit', 'o']; |
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
| /* | |
| * This work is free. You can redistribute it and/or modify it under the | |
| * terms of the Do What The Fuck You Want To Public License, Version 2, | |
| * as published by Sam Hocevar. See the COPYING file for more details. | |
| */ | |
| /* | |
| * Easing Functions - inspired from http://gizma.com/easing/ | |
| * only considering the t value for the range [0, 1] => [0, 1] | |
| */ | |
| EasingFunctions = { |
| function debugAccess(obj, prop, debugGet){ | |
| var origValue = obj[prop]; | |
| Object.defineProperty(obj, prop, { | |
| get: function () { | |
| if ( debugGet ) | |
| debugger; | |
| return origValue; | |
| }, |
| #301 Redirects for .htaccess | |
| #Redirect a single page: | |
| Redirect 301 /pagename.php http://www.domain.com/pagename.html | |
| #Redirect an entire site: | |
| Redirect 301 / http://www.domain.com/ | |
| #Redirect an entire site to a sub folder | |
| Redirect 301 / http://www.domain.com/subfolder/ |
| var portrange = 45032 | |
| function getPort (cb) { | |
| var port = portrange | |
| portrange += 1 | |
| var server = net.createServer() | |
| server.listen(port, function (err) { | |
| server.once('close', function () { | |
| cb(port) |
| <html> | |
| <body> | |
| <video id="v" width="300" height="300"></video> | |
| <input id="b" type="button" disabled="true" value="Take Picture"></input> | |
| <canvas id="c" style="display:none;" width="300" height="300"></canvas> | |
| </body> | |
| <script> | |
| navigator.getUserMedia({video: true}, function(stream) { | |
| var video = document.getElementById("v"); | |
| var canvas = document.getElementById("c"); |
Backstory: I decided to crowdsource static site generator recommendations, so the following are actual real world suggested-to-me results. I then took those and sorted them by language/server and, just for a decent relative metric, their Github Watcher count. If you want a heap of other projects (including other languages like Haskell and Python) Nanoc has the mother of all site generator lists. If you recommend another one, by all means add a comment.
| (function( $ ) { | |
| $.fn.simulateDragDrop = function(options) { | |
| return this.each(function() { | |
| new $.simulateDragDrop(this, options); | |
| }); | |
| }; | |
| $.simulateDragDrop = function(elem, options) { | |
| this.options = options; | |
| this.simulateEvent(elem, options); | |
| }; |