Skip to content

Instantly share code, notes, and snippets.

Nathan Ostgard noonat

Block or report user

Report or block noonat

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View kafka_consumer.go
package main
import (
"flag"
"log"
"os"
"os/signal"
"strings"
"github.com/Shopify/sarama"
View grid-step.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<style type="text/css">
body {
margin: 0;
padding: 0;
}
canvas {
View concat-reduce-1.js
// really slow: ~50s
try {
return ret.concat.apply([], ret);
} catch (e) {
if (e instanceof RangeError && ret.reduce) {
return ret.reduce(function(a, b) {
return a.concat(b);
}, [])
} else {
throw e;
View get_subs.py
#!/usr/bin/env python
from __future__ import print_function
import argparse
import os
import requests
import sys
import zlib
from pythonopensubtitles import opensubtitles, utils
@noonat
noonat / level1.py
Created Jan 24, 2013
Some code to solve the Colossal Cue puzzles at http://adventure.cueup.com/
View level1.py
m = 4294967296
a = 69069
c = 1
seed = 6
for i in range(4):
seed = (a * seed + c) % m
print "%i" % (seed % 36)
@noonat
noonat / Cube.as
Created Feb 28, 2011
Molehill Example: Spinning Cube
View Cube.as
/**
* Spinning cube in Molehill.
* http://ltslashgt.com/2011/02/28/molehill-spinning-cube/
*/
package {
import com.adobe.utils.AGALMiniAssembler;
import flash.display.Sprite;
import flash.display.Stage3D;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
View gzip_postfix_man_files.sh
FILES=$(echo "man1/mailq.1
man1/newaliases.1
man1/postalias.1.gz
man1/postcat.1.gz
man1/postconf.1.gz
man1/postdrop.1.gz
man1/postfix.1.gz
man1/postkick.1.gz
man1/postlock.1.gz
man1/postlog.1.gz
View powerset.coffee
powerSet = (set) ->
p = [[]]
for val in set
for i in [0...p.length]
p[p.length] = p[i].concat([val])
p
View mongo.js
$ mongo
MongoDB shell version: 2.0.0
connecting to: test
> quit
function () {
return nativeHelper.apply(quit_, arguments);
}
> quit.toString = function() { return 'Type quit() to quit.'; }
function () {
return "Type quit() to quit.";
@noonat
noonat / Main.hx
Created Aug 10, 2011
Apple property list parser in HaXe
View Main.hx
/**
* Apple property list parser.
*
* For example, the following property list XML:
*
* <?xml version="1.0" encoding="UTF-8"?>
* <plist version="1.0">
* <dict>
* <key>foo</key>
* <integer>1</key>
You can’t perform that action at this time.