Skip to content

Instantly share code, notes, and snippets.

@wandernauta
wandernauta / llamize.sh
Created November 25, 2012 18:56
llamize
#!/bin/bash
#
# llamize
# Stub a llama-standard ooc library/binding.
#
# Check if a name is given.
if [[ -z $1 ]]; then
echo "Usage: llamize <name>"
#include <cstdio>
#include <cstdlib>
#include <string>
#include <map>
#include <vector>
//===----------------------------------------------------------------------===//
// Lexer
//===----------------------------------------------------------------------===//
@wandernauta
wandernauta / anews.sh
Created December 22, 2011 13:47
Read the Arch Linux news feed on the console.
#
# anews.sh
# Read the Arch Linux news feed on the console
#
# Put (or source) this in your .zsh_profile or whatever.
#
# Usage:
# $ anews
#
# Bugs:
@wandernauta
wandernauta / cheat.sh
Created December 10, 2011 19:47
Read cheat sheets from cheat.errtheblog.com without Ruby.
#
# cheat.sh
# Read cheat sheets from cheat.errtheblog.com without Ruby.
#
# Put (or source) this in your .zsh_profile or whatever.
#
# Usage:
# $ cheat sheets
# $ cheat recent
# $ cheat zsh
@wandernauta
wandernauta / gist:993502
Created May 26, 2011 16:53
Crash description
Process: httpd [19368]
Path: /usr/sbin/httpd
Identifier: httpd
Version: ??? (???)
Code Type: X86-64 (Native)
Parent Process: httpd [1599]
Date/Time: 2011-05-26 18:13:08.560 +0200
OS Version: Mac OS X 10.6.6 (10J567)
Report Version: 6
@wandernauta
wandernauta / abbrev.py
Created May 22, 2011 19:37
A quick Python port of the Ruby Abbrev module
#!/usr/bin/python
"""
Copyright (c) 2011 Wander Nauta http://wandernauta.nl
This is a based on the Abbrev module that ships with Ruby, by Akinori Mushi.
Thanks, Akinori!
This snippet is distributed in the hope that it will be useful, but WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND. Have fun.
@wandernauta
wandernauta / bottles.ooc
Created January 24, 2011 15:53
99 Bottles of Beer in ooc!
bottles := 99
while (bottles >= 0) {
if (bottles >= 2) { "%d bottles of beer on the wall, %d bottles of beer." printfln(bottles, bottles) }
if (bottles == 1) { "1 bottle of beer on the wall, 1 bottle of beer." println() }
if (bottles == 0) {"No more bottles of beer on the wall, no more bottles of beer." println() }
if (bottles >= 2) { "Take one down and pass it around, %d bottles of beer on the wall.\n" printfln(bottles-1) }
if (bottles == 1) { "Take one down and pass it around, no more bottles of beer on the wall.\n" println() }
if (bottles == 0) { "Go to the store and buy some more, 99 bottles of beer on the wall.\n" println() }
{"pages":[
{"title": "Foo Bar", "content": "Foos are the best bar"},
{"title": "Foo Bar", "content": "Foos are the best bar"}
]}
@wandernauta
wandernauta / bacon-demo.ooc
Created December 5, 2010 20:18
Bacon is a HTML generation library for ooc. It doesn't really exist just yet.
import bacon
root = BaconRoot new()
root add("body") add("div#someid") add("strong.someclass") text("Cóól story bro")
root out() println()
/*
would print something like...
def fib():
seq = []
num1 = 1
num2 = 1
num3 = 0
seq.append(num1)
seq.append(num2)
seq.append(num3)