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)
sub, sup { | |
/* Specified in % so that the sup/sup is the | |
right size relative to the surrounding text */ | |
font-size: 75%; | |
/* Zero out the line-height so that it doesn't | |
interfere with the positioning that follows */ | |
line-height: 0; | |
/* Where the magic happens: makes all browsers position |
//******************************************* | |
// Level 1, basic API, minimum support | |
//******************************************* | |
/* | |
Modules IDs are strings that follow CommonJS | |
module names. | |
*/ | |
//To load code at the top level JS file, | |
//or inside a module to dynamically fetch |
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)
/** | |
* Modified from the Connect project: https://github.com/senchalabs/connect/blob/master/lib/middleware/errorHandler.js | |
* | |
* Flexible error handler, providing (_optional_) stack traces and logging | |
* and error message responses for requests accepting text, html, or json. | |
* | |
* Options: | |
* | |
* - `showStack` respond with both the error message and stack trace. Defaults to `false` | |
* - `showMessage`, respond with the exception message only. Defaults to `false` |
This gist assumes:
An introduction to curl
using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
var parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |
// Create the test | |
var pixelRatio = (window.devicePixelRatio >= 1.5) ? "high" : "normal"; | |
.. | |
// Pass it along through GA | |
var _gaq = _gaq || []; | |
_gaq.push(['_setAccount', 'UA-xxxxxxxx-x']); | |
// --- IMPORTANT LINE! | |
// params: event method, custom variable slot, variable name, variable value, scope level |
#!/bin/bash | |
# REQUIRES SUDO | |
# Benchmark runner | |
repeats=20 | |
output_file='benchmark_results.csv' | |
command_to_run='echo 1' | |
run_tests() { | |
# -------------------------------------------------------------------------- |