Skip to content

Instantly share code, notes, and snippets.

View chapel's full-sized avatar

Jacob Chapel chapel

View GitHub Profile
https://gist.github.com/830022
var http = require('http');
var querystring = require('querystring');
var data = {
message: 'Hello'
};
var form_data = querystring.stringify(data);
var options = {
exports.exec = (options, callback) ->
# Load image
fs.readFile './image.jpg', (err, img) ->
if err
return callback(err, null);
# POST image to imgur
request {
method: 'POST',
body: "image=" + img.toString() + "&key=42e1c4982b52fabcae9033ff428d5175",
uri: 'http://imgur.com/api/upload.json',
[20:18] mraleph: ryah: I have an interesting observation for you about that infamous and sad comparison with erlang. If I throttle accept (i.e. accept return after 50 accepted connections from https://github.com/joyent/node/blob/master/lib/net.js#L907 then response rate seems to improve by 20-30% and number of errors drops.
[20:18] baudehlo: haven't they always?
[20:18] baudehlo: a|i: https://github.com/squaremo/rabbit.js
[20:19] ryah: mraleph: interesting
[20:19] mjr_: mraleph: I figured it was something like that
[20:19] ryah: do you think we're blocked on accepting?
[20:19] kersny has joined the channel
[20:19] ryah: that's an easy fix
[20:19] a|i: baudehlo: any ideas which approach is more efficient?
[20:19] AsDfGh1231 has joined the channel
/*===========================================================================
SETTINGS
============================================================================= */
var port = 3000,
cacheAge = 60000 * 60 * 24 * 365,
logs = {
set: false,
string: '\\n ' + ':date'.bold.underline + '\\n\\n' + ' IP: '.cyan.bold
+ ' ' + ':remote-addr'.white + '\\n' + ' Method: '.red.bold
/ Fatalities
var fatalities = {
triggers: {
konamiCode: function(scriptPath, scriptFn) {
console.log("Added function");
var konamiKeys = [], konamiCombo = "38,38,40,40,37,39,37,39,66,65";
$(document).keydown(function(e) {
konamiKeys.push(e.keyCode);
if(konamiKeys.toString().indexOf(konamiCombo) >= 0) {
$(document).unbind('keydown', arguments.callee);
<!doctype html>
<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en"> <![endif]-->
<!-- Consider adding a manifest.appcache: h5bp.com/d/Offline -->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8">
{
"status": "ok",
"data" {
"id": "a271659310088dc1a09fe0af9ddf6dd2d1987ddb99d2ca23af50a7fae55256d9",
"name": "Jacob Chapel",
"screen_name": "chapel",
"avatar": {
"small": "http://a1.twimg.com/profile_images/1340947562/me_badass_ava_normal.png",
"large": "http://a1.twimg.com/profile_images/1340947562/me_badass_ava.png"
},
{
"status": "ok",
"data": {
"total_cards": 1,
[
{
short_code: {
id: "32002d0dea77d1e55dcdb17b93456b789f0726b659e2d605bd6047db6c046865",
gklst_url: "http://gkl.st/XuQdJ"
},
{
"status": "ok",
"data": {
short_code: {
id: "32002d0dea77d1e55dcdb17b93456b789f0726b659e2d605bd6047db6c046865",
gklst_url: "http://gkl.st/XuQdJ"
},
contributors: [
"ae018441bd0ade5ea2cf89e2bc30adf15b4178dde72cc86e5d4b7b8dce55c743"
],