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
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
// 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, |
NewerOlder