Skip to content

Instantly share code, notes, and snippets.

View aking's full-sized avatar
🕶️
Focusing

Adam King aking

🕶️
Focusing
  • Now: EpicGames iOS Platform Engineer. Prev: 3D Game Programmer (NDS/Wii/iOS/PSP/Android)
View GitHub Profile
@mjg123
mjg123 / helloclosure.cljs
Created July 21, 2011 23:48
Same jsonp call as before but with gclosure instead of jQuery
(ns helloclosure
(:require [goog.net.Jsonp :as jsonp]))
(defn show [msg]
(let [data-as-json ((js* "JSON.stringify") msg nil 4)]
((js* "alert") data-as-json)))
(defn doajax []
(.send (goog.net.Jsonp. (goog.Uri. "http://api.stackoverflow.com/1.1/users/268619") "jsonp")
nil
@codeboost
codeboost / test-32k.js
Created November 12, 2010 10:15
Sending large buffers through SSL connection causes the other side to stop receiving the data
const
util = require('util'),
net = require('net'),
crypto = require('crypto'),
fs = require('fs'),
Buffer = require('buffer').Buffer,
http = require('http'),
url = require('url');
var privateKey = fs.readFileSync('../cert/privatekey.pem').toString();
@billywhizz
billywhizz / lighttpd.conf
Created October 30, 2010 01:48
example of working fastcgi responder
fastcgi.server = ( ".js" =>
(( "socket" => "/tmp/js-fastcgi.socket",
"bin-path" => "/node-fastcgi/examples/responder.js",
"check-local" => "disable"
))
)
@tanepiper
tanepiper / twitter_oauth_getter.js
Created September 11, 2010 16:14
A small command line nodejs script for doing Twitter OAuth.
#!/usr/bin/env node
var argv = require('optimist')
.usage('Usage: --key=[consumer key] -secret=[consumer secret]')
.demand(['key', 'secret'])
.argv
;
var OAuth = require('oauth').OAuth;
var Step = require('step');