Skip to content

Instantly share code, notes, and snippets.

Avatar
🤙
!

Sean Robertson spro

🤙
!
View GitHub Profile
@spro
spro / why_spool.sh
Created Apr 18, 2013
Follow _why's SPOOL in real time.
View why_spool.sh
#!/bin/sh
# Read _why's SPOOL in real time.
# Requires `lp` and a printer.
BASEURL=http://whytheluckystiff.net
if [ ! -d SPOOL ]; then
mkdir SPOOL
fi
View nginx_minimal.conf
events {
worker_connections 1024;
}
http {
include mime.types;
server {
listen 8080;
server_name localhost;
@spro
spro / nginx_lua.conf
Created Sep 9, 2013
Example nginx configuration with a simple Lua script acting at /hello
View nginx_lua.conf
events {
worker_connections 1024;
}
http {
include mime.types;
server {
listen 8080;
server_name localhost;
View nfl_bottomline_parser.coffee
http = require 'http'
fs = require 'fs'
util = require 'util'
qs = require 'querystring'
get_score_data = ->
http.get 'http://sports.espn.go.com/nfl/bottomline/scores', (res) ->
data = ''
res.on 'data', (chunk) ->
data += chunk
View comment_insertion.coffee
insert_comment = ($comments, comment_data) ->
# add this comment into the given $comments div somehow
$ ->
# create $comments
$comments = $('<div id="comments">')
$.get '/posts/123/comments.json', (comments_data) ->
for comment_data in comments_data
insert_comment $comments, comment_data
@spro
spro / gist:8839678
Last active Apr 7, 2016
Error in `node': corrupted double-linked list
View gist:8839678
*** Error in `node': corrupted double-linked list: 0x000000000a61c4b0 ***
======= Backtrace: =========
/usr/lib/libc.so.6(+0x72d7f)[0x7fb7d3285d7f]
/usr/lib/libc.so.6(+0x7854e)[0x7fb7d328b54e]
/usr/lib/libc.so.6(+0x795c9)[0x7fb7d328c5c9]
/usr/lib/libjpeg.so.8(+0x2ce1d)[0x7fb7d218fe1d]
/usr/lib/libjpeg.so.8(jpeg_abort+0x15)[0x7fb7d2175bf5]
/usr/lib/libjpeg.so.8(jpeg_finish_decompress+0x54)[0x7fb7d2179ad4]
/usr/lib/libvips.so.37(+0x11b318)[0x7fb7d297c318]
/usr/lib/libgobject-2.0.so.0(g_closure_invoke+0x138)[0x7fb7d19b66a8]
@spro
spro / gist:8851965
Created Feb 6, 2014
valgrind --leak-check=yes node cropper.js
View gist:8851965
-- these occur frequently:
==20106== Conditional jump or move depends on uninitialised value(s)
==20106== at 0x810B6B6: ??? (in /usr/lib/libjpeg.so.8.0.2)
==20106== by 0x8107CA3: ??? (in /usr/lib/libjpeg.so.8.0.2)
==20106== by 0x810C682: ??? (in /usr/lib/libjpeg.so.8.0.2)
==20106== by 0x8106DC9: jpeg_read_scanlines (in /usr/lib/libjpeg.so.8.0
==20106== by 0x77CB53F: read_jpeg_generate (jpeg2vips.c:932)
==20106== by 0x77F3A38: vips_region_generate (region.c:1074)
==20106== by 0x77F4B0F: vips_region_prepare_to_generate (region.c:1196)
@spro
spro / cropper.coffee
Last active Aug 29, 2015
Image cropping service in CoffeeScript
View cropper.coffee
http = require 'http'
url = require 'url'
sharp = require 'sharp'
request = require('request').defaults({ encoding: null })
config =
PORT: 2455
server = http.createServer (req, res) ->
View keybase.md

Keybase proof

I hereby claim:

  • I am spro on github.
  • I am spro (https://keybase.io/spro) on keybase.
  • I have a public key whose fingerprint is C66D 0B30 C6AD 364F 48D5 F21F 087C 2F86 D07C 4554

To claim this, I am signing this object:

View rainforest.coffee
fs = require 'fs'
util = require 'util'
exec = require('child_process').exec
jsdom = require 'jsdom'
jquery = require 'jquery'
_ = require 'underscore'
# Github APIs require a user agent to be set, so set one by default
request = require('request')