Skip to content

Instantly share code, notes, and snippets.

@madmo
madmo / main.rb
Created October 15, 2012 23:02
Some forth-like interpreter/hack
#!/usr/bin/ruby
require 'thread'
class Lexer
attr_accessor :start
attr_accessor :pos
attr_accessor :tokens
def initialize (input, output)
@madmo
madmo / build-mspgcc.sh
Created August 30, 2012 23:15
OSX msp430 toolchain install script
#!/bin/bash
# Based on the script found here: http://xpg.dk/projects/msp430/msp430-gcc-uniarch-build-script/
# brew install gmp mpfr libmpc
set -e
function gitUpdate()
{
SRC_ROOT=$1
@madmo
madmo / fanotify.go
Created June 28, 2012 11:34
GO fanotify api
// Copyright (c) 2012, Moritz Bitsch <moritzbitsch@googlemail.com>
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
@madmo
madmo / gist:2916217
Created June 12, 2012 08:36
Simple Daemon
package main
import (
"bitbucket.org/madmo/daemonize"
"fmt"
"log"
"log/syslog"
"os"
"os/signal"
)