Skip to content

Instantly share code, notes, and snippets.

Matthew Frazier leafstorm

Block or report user

Report or block leafstorm

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
leafstorm / networking.rst
Created Jan 7, 2011
This is a sample chapter that doesn't make much sense after the first section intended to demonstrate reStructuredText for the Lua cookbook.
View networking.rst

Networking with LuaSocket

.. author:: Matthew Frazier <>

The most common library for networking in Lua is `LuaSocket`_ by Diego Nehab. In addition to low-level support for communicating directly through sockets, it also includes:

leafstorm / gist:782073
Created Jan 16, 2011
Example Thor file for testing using Gists with Thor.
View gist:782073
class Hello < Thor
include Thor::Actions
desc "hello NAME", "says hello to the given NAME"
def hello (name="World")
say "Hello, #{name}! It's nice to meet you!"
leafstorm / lasi.rst
Created Jan 22, 2011
A draft of a Lua gateway interface to replace WSAPI.
View lasi.rst

Lua Application/Server Interface version 1.0

Author: Matthew "LeafStorm" Frazier <>
Date: February 4, 2011
Status: Early draft

This document specifies an interface between Web servers and Web applications written in the Lua programming language, to promote interoperability between Web servers and the development of an ecosystem of reusable components for Lua

leafstorm / craftr.rb
Created Jun 5, 2011
Minecraft server management script
View craftr.rb
#!/usr/bin/env ruby
# craftr
# This manages a Craftbukkit server. It helps you start it, stop it,
# back up your world, and download specific Craftbukkit builds.
# You must "gem install thor" first.
# Run it in your server directory.
require 'thor'
require 'yaml'
leafstorm /
Created Aug 15, 2011
Better activate function for fish
# drop this in your ~/.config/fish/functions
function activate --description "Activate a virtual environment"
# find the target
set target $argv[1]
if test -z $target
set target $PWD
# expand the path in $target
leafstorm / index_template.html
Created Sep 8, 2011
UnWRAP, a WRAP authentication relay for NCSU. Actual UnWRAP script, Python library, and example Flask app with template. Released under the MIT license.
View index_template.html
<!doctype html>
<title>UnWRAP Test</title>
<style type="text/css">
p.flash {
font-style: italic;
text-align: center;
p.message {
leafstorm /
Created Oct 18, 2011
Script that installs Distribute, pip, and virtualenv in your home directory.
echo "== This script will install Distribute, pip, and virtualenv"
echo " in your home directory for Python $version."
DISTRIBUTE_TEMP=$(mktemp -p "${TMPDIR:-.}" -d distribute-XXX) || {
echo "Could not create temporary working directory"
exit 1
leafstorm / benchmarks-aof-everysec.txt
Created Feb 11, 2012
Some Redis benchmarks on
View benchmarks-aof-everysec.txt
# Benchmarks run with the Append Only File on everysec
# redis-server run with default settings, except for appendonly yes
# src/redis-benchmark -d 16 -n 1000000
# at the end of the benchmark, appendonly.aof was 48 MB
====== PING (inline) ======
1000000 requests completed in 6.54 seconds
50 parallel clients
16 bytes payload
leafstorm / gist:2323188
Created Apr 6, 2012
PEG.js parser for DCPU-16 assembly language
View gist:2323188
* Parser for DCPU-16 assembly language.
* This parser should accurately parse all of Notch's example code, and most
* of the community's code.
* It converts instructions to objects with fields {op, params, label}.
* op is the lowercased opcode, params is the parameters passed to it (as
* values), and label is the label prefixing the statement (null if the
* statement is unlabelled).
* Values have a type field and one or two others depending on the type.
leafstorm / gist:2907123
Created Jun 10, 2012
ItemBox, A serialization format I never got around to implementing
View gist:2907123

ItemBox 1.0 draft 1

ItemBox is a binary format for serializing data in a language-independent way, similar to JSON, YAML, BSON, MessagePack, and other formats. ItemBox is specifically designed for encoding and decoding speed, space efficiency, and ease of implementation.

Types Representable

You can’t perform that action at this time.