Skip to content

Instantly share code, notes, and snippets.

@mcroydon
mcroydon / sc2.tex
Created September 21, 2011 16:30
The beginnings of a SC2 cheat sheet, in LaTeX of course.
\documentclass[10pt,landscape]{article}
\usepackage{multicol}
\usepackage{calc}
\usepackage{ifthen}
\usepackage{hyperref}
\usepackage[landscape]{geometry}
% SC2 Cheat Sheet, initially aimed at Terran.
% To make a PDF: pdflatex sc2.tex
% If you don't have LaTeX already, grab TeX Live, MacTeX, or check apt/brew/etc.
350 BackendOpen b scni_daniel 10.0.0.15 59005 10.0.0.69 8256
350 TxRequest b GET
350 TxURL b /news/2009/dec/30/wolves-sunk-at-buzzer/
350 TxProtocol b HTTP/1.1
350 TxHeader b Host: www.gwinnettdailypost.com
350 TxHeader b User-Agent: Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_0 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mo
bile/7A341 Safari/528.16
350 TxHeader b Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
350 TxHeader b Accept-Language: en-us,en;q=0.5
350 TxHeader b Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Year,Total
1995,146
1996,184
1997,235
1998,200
1999,226
2000,251
2001,299
2002,273
2003,281
package com.postneo
package index
package test
import org.apache.lucene.analysis.SimpleAnalyzer
import org.apache.lucene.analysis.standard.StandardAnalyzer
import org.apache.lucene.document.{Document, Field}
import org.apache.lucene.index.{IndexWriter, Term}
import org.apache.lucene.search.{IndexSearcher, Query, TermQuery, TopDocs}
import org.apache.lucene.store.RAMDirectory
@mcroydon
mcroydon / aprsbot.js
Created July 6, 2011 01:15
An IRC bot for looking up APRS checkins using node.js and node-irc.
var irc = require('irc');
var http = require('http');
var name = 'aprsbot';
var channel = '#avgeek';
var api_key = 'XXXXX';
var client = new irc.Client('irc.freenode.net', name, {channels: [channel]})
client.addListener('message', function(from, to, message) {
@mcroydon
mcroydon / pypy.diff
Created May 1, 2011 04:44
Update homebrew formula to 1.5.0 for 64-bit; keep 1.4.1 for 32-bit.
diff --git a/Library/Formula/pypy.rb b/Library/Formula/pypy.rb
index ace63b2..cb79dad 100644
--- a/Library/Formula/pypy.rb
+++ b/Library/Formula/pypy.rb
@@ -3,14 +3,15 @@ require 'hardware'
class Pypy < Formula
if MacOS.prefer_64_bit?
- url 'http://pypy.org/download/pypy-1.4.1-osx64.tar.bz2'
- md5 '769b3fb134944ee8c22ad0834970de3b'
@mcroydon
mcroydon / Eep.scala
Created April 25, 2011 20:31
A Scala port of the "Hello SimpleApplication" app from the jMonkeyEngine wiki
// A scala port of http://jmonkeyengine.org/wiki/doku.php/jme3:beginner:hello_simpleapplication
package com.postneo
package eep
import com.jme3.app.SimpleApplication
import com.jme3.material.Material
import com.jme3.math.Vector3f
import com.jme3.scene.Geometry
import com.jme3.scene.shape.Box
@mcroydon
mcroydon / main.py
Created March 25, 2011 05:00
Source to isitfridayfridayfriday.appspot.com
from google.appengine.ext import webapp
from google.appengine.ext.webapp import util
class IsItFridayFridayFridayHandler(webapp.RequestHandler):
def get(self):
self.response.out.write("""<html><head><title>Is it Friday Friday Friday?</title>
<style type="text/css">
.big {font-size: 5em; margin-top: 2.5em; margin-bottom: 1em;}
.center {text-align: center;}
.friday {color: green;}
@mcroydon
mcroydon / charcount.scala
Created February 14, 2011 14:09
Looking at the Actor tax for simple I/O bound operations. With actors it takes ~1000ms. Without it takes ~450ms.
package com.postneo
package toys
package charcount
import scala.actors.Actor
import scala.actors.Actor._
import scala.io.Source
// Iterate over lines in a file, summing the total.
object CharCount {
package com.mypackage.benchmark
import com.mypackage.util.Logging
import net.lag.configgy.Configgy
import scala.collection.mutable
import scala.collection.JavaConversions._
import java.net.InetSocketAddress
import java.nio.charset.Charset
import java.util.concurrent._