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)
/** @jsx React.DOM */ | |
var STATES = [ | |
'AL', 'AK', 'AS', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DE', 'DC', 'FL', 'GA', 'HI', | |
'ID', 'IL', 'IN', 'IA', 'KS', 'KY', 'LA', 'ME', 'MD', 'MA', 'MI', 'MN', 'MS', | |
'MO', 'MT', 'NE', 'NV', 'NH', 'NJ', 'NM', 'NY', 'NC', 'ND', 'OH', 'OK', 'OR', | |
'PA', 'RI', 'SC', 'SD', 'TN', 'TX', 'UT', 'VT', 'VA', 'WA', 'WV', 'WI', 'WY' | |
] | |
var Example = React.createClass({ |
# | |
# Overloads: | |
# - fetch(url, callback) | |
# - fetch(url, opts, callback) | |
# | |
fetch = (args...) -> | |
[arg0, arg1, arg2] = args | |
[url, opts, callback] = switch args.length | |
when 0, 1 then throw new Error "Usage: fetch(url[, opts], callback)" | |
when 2 then [arg0, null, arg1] |
#!/usr/bin/env _coffee | |
# | |
# Migrates our Streamline v0.1 files to the new Streamline v0.3 extensions, | |
# i.e. git-moves all foo_.coffee files to foo._coffee. | |
{exec} = require 'child_process' | |
Path = require 'path' | |
# regex to recognize old-style streamline files: | |
STREAMLINE_REGEX = /_\.(js|coffee)$/ |
body { | |
font-family: Helvetica, arial, sans-serif; | |
font-size: 14px; | |
line-height: 1.6; | |
padding-top: 10px; | |
padding-bottom: 10px; | |
background-color: white; | |
padding: 30px; } | |
body > *:first-child { |
var request = require('request'); | |
var settings = { | |
AKAMAI_USER: 'test', | |
AKAMAI_PASSWORD: '...', | |
AKAMAI_NOTIFICATION_EMAIL: '' | |
}; | |
var akamai = exports; | |
var SOAP_URL = 'https://ccuapi.akamai.com:443/soap/servlet/soap/purge'; |
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)
> var err = new Error('wtf?'); | |
> JSON.stringify(err) | |
'{"stack":"Error: wtf?\\n at [object Context]:1:11\\n at Interface.<anonymous> (repl.js:179:22)\\n at Interface.emit (events.js:64:17)\\n at Interface._onLine (readline.js:153:10)\\n at Interface._line (readline.js:408:8)\\n at Interface._ttyWrite (readline.js:585:14)\\n at ReadStream.<anonymous> (readline.js:73:12)\\n at ReadStream.emit (events.js:81:20)\\n at ReadStream._emitKey (tty_posix.js:307:10)\\n at ReadStream.onData (tty_posix.js:70:12)","message":"wtf?"}' | |
> Object.keys(err); | |
[ 'stack', 'arguments', 'type', 'message' ] | |
> Object.getOwnPropertyDescriptor(err, 'stack'); | |
{ get: [Function], set: [Function], enumerable: true, configurable: true } | |
> process.versions.v8 | |
'3.1.8.26' |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Image Pyramid Demo</title> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
<meta name="viewport" content="width=device-width,height=device-height,initial-scale=1.0,user-scalable=no"> | |
<script src="pyramiddemo.js"></script> | |
<style> | |
body { |
/* | |
Some simple Github-like styles, with syntax highlighting CSS via Pygments. | |
*/ | |
body{ | |
font-family: helvetica, arial, freesans, clean, sans-serif; | |
color: #333; | |
background-color: #fff; | |
border: none; | |
line-height: 1.5; | |
margin: 2em 3em; |