This file contains hidden or 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
// cURL: http://php.net/manual/en/book.curl.php | |
// cURL Options: http://www.php.net/manual/en/function.curl-setopt.php | |
// @param $url URL of the request, e.g. https://www.sandbox.paypal.com/cgi-bin/webscr | |
// @param $data URL encoded request data as array, e.g. $data = array('cmd' => '_notify-validate'); | |
function urlopen($url, $data) | |
{ | |
$curl_handler = curl_init(); | |
$options = array(CURLOPT_URL => $url, | |
CURLOPT_FAILONERROR => true, | |
CURLOPT_RETURNTRANSFER => true, |
This file contains hidden or 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
import base64 | |
import hashlib | |
import hmac | |
import simplejson as json | |
def base64_url_decode(inp): | |
padding_factor = (4 - len(inp) % 4) % 4 | |
inp += "="*padding_factor | |
return base64.b64decode(unicode(inp).translate(dict(zip(map(ord, u'-_'), u'+/')))) |
This file contains hidden or 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
// app-dev.js | |
// Helper script to register CoffeeScript and Streamline extension handlers | |
// before running an app during development. | |
// | |
// Uses https://github.com/aseemk/coffee-streamline for efficient require(), | |
// caching compiled files between runs. Sweet! | |
// | |
// Usage: instead of `_coffee app`, just do `node app-dev app`. | |
// | |
// Also works great w/ node-dev <https://github.com/fgnass/node-dev>: |
This file contains hidden or 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
/* | |
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; |
This file contains hidden or 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>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 { |
This file contains hidden or 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 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' |
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 file contains hidden or 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 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'; |
This file contains hidden or 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
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 { |
OlderNewer