See .
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 performance = (function () { | |
var my = {}; | |
// Wrap a function body in this to return a copy that instruments itself | |
// If you want this to be useful, you should give your profiled function a name, | |
// otherwise it will be identified as "", which is less than useful. | |
my.profile = function (func) { | |
return function () { | |
var start = new Date().getTime(), | |
time, |
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
/* | |
* object.watch polyfill | |
* | |
* 2012-04-03 | |
* | |
* By Eli Grey, http://eligrey.com | |
* Public Domain. | |
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. | |
*/ |
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
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir ~/local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
./configure --prefix=~/local | |
make install # ok, fine, this step probably takes more than 30 seconds... | |
curl https://www.npmjs.org/install.sh | sh |
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
!!! 5 | |
html(class='no-js') | |
head | |
meta(charset='utf-8') | |
meta(http-equiv='X-UA-Compatible', content='IE=edge') | |
title | |
meta(name='description', content='') | |
meta(name='viewport', content='width=device-width, initial-scale=1') |
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
# This script watches for changes in a document and constantly resaves a file | |
# with the document's contents. | |
# | |
# Usage: coffee saver.coffee -d <DOCNAME> [--url http://somehost:8000/sjs] [-f filename] | |
client = require('share').client | |
fs = require('fs') | |
argv = require('optimist') | |
.usage('Usage: $0 -d docname [--url URL] [-f filename]') |
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> | |
<title>CSS Pulsator</title> | |
<link rel="stylesheet" type="text/css" href="style.css" /> | |
</head> | |
<body> | |
<div id="pulsor">Pulsate!</div> | |
</body> | |
</html> |
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 page = new WebPage(), | |
address, output, size; | |
address = "http://www.metachunk.com/"; | |
width = 1024; height = 600; | |
output = "./screenshots/wat-"+width+"X"+height+".png"; | |
page.viewportSize = { width: width, height: height }; | |
if (phantom.args.length === 3 && phantom.args[1].substr(-4) === ".pdf") { |
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
(function() { | |
var EventEmitter = require('events').EventEmitter; | |
var inspect = require('util').inspect; | |
var emit_ = EventEmitter.prototype.emit; | |
EventEmitter.prototype.emit = function(name) { | |
var args = Array.prototype.slice.call(arguments); | |
if (!(this === process.stderr && name === 'drain')) { | |
console.error("Event '%s', arguments: %s", | |
name, inspect(args.slice(1), false, 1)); | |
} |
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
/** | |
* normalizeEvent | |
* | |
* Firefox does not implement offsetX, OffsetY, so we have to detect for this an | |
* manually calculate it ourselves using the pageX, pageY less the event | |
* target's left offset and right offset | |
* | |
* If using a browser that supports offsetX, OffsetY, just return the event, | |
* don't need to do anything | |
*/ |
OlderNewer