Skip to content

Instantly share code, notes, and snippets.

@leafstorm
leafstorm / activate.fish
Created August 15, 2011 17:39
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
end
# expand the path in $target
@leafstorm
leafstorm / craftr.rb
Created June 5, 2011 15:17
Minecraft server management script
#!/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
leafstorm / lasi.rst
Created January 22, 2011 21:47
A draft of a Lua gateway interface to replace WSAPI.

Lua Application/Server Interface version 1.0

Author

Matthew "LeafStorm" Frazier <leafstormrush@gmail.com>

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
leafstorm / gist:782073
Created January 16, 2011 19:39
Example Thor file for testing using Gists with Thor.
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!"
end
end
@leafstorm
leafstorm / networking.rst
Created January 7, 2011 19:49
This is a sample chapter that doesn't make much sense after the first section intended to demonstrate reStructuredText for the Lua cookbook.

Networking with LuaSocket

Matthew Frazier <leafstormrush@gmail.com>

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: