Skip to content

Instantly share code, notes, and snippets.

View bshillingford's full-sized avatar

Brendan Shillingford bshillingford

View GitHub Profile
@Deco
Deco / deepcopy.lua
Created October 31, 2012 05:38
Lua Non-recursive Deep-copy
--[[ deepcopy.lua
Deep-copy function for Lua - v0.2
==============================
- Does not overflow the stack.
- Maintains cyclic-references
- Copies metatables
- Maintains common upvalues between copied functions (for Lua 5.2 only)
TODO
@afair
afair / tmux.cheat
Last active June 3, 2024 23:26
Tmux Quick Reference & Cheat sheet - 2 column format for less scrolling!
========================================== ==========================================
TMUX COMMAND WINDOW (TAB)
========================================== ==========================================
List tmux ls List ^b w
New new -s <session> Create ^b c
Attach att -t <session> Rename ^b , <name>
Rename rename-session -t <old> <new> Last ^b l (lower-L)
Kill kill-session -t <session> Close ^b &
@jamesrcounts
jamesrcounts / README.md
Created July 7, 2012 01:32
String.Contains, C# Finite State Machine Implementation

String.Contains C# Edition

I enjoy playing with state machines. They are simple enough to implement quickly, and complex enough to give the implementation language a little workout. Followers of this blog will know that I've enjoyed using Finite State Machines to explore CoffeeScript.

But, when I look at the search terms leading to my blog, I see that people want to see FSMs implemented in C#, C++, or even VB. About the only language I haven't seen people looking for is CoffeeScript. I'm not too suprised, since most people searching for FSM implementations are probably students trying to cheat on thier homework. I doubt any professors are accepting CoffeeScript implemenations.

When I see these search results, I consider quickly posting a solution in the requested language. I don't mind if students crib solutions from me. I'm a big believer in learning by example. Certainly if by looking at my FSMs I can save one student from writing a switch statement, then I'll consider it a public serv

@lbolla
lbolla / pipeline_1.py
Created April 20, 2012 12:34
Python pipelines
'''Pipeline
(yield) -> receiver
.send -> producer
'''
import time
N = 0