Skip to content

Instantly share code, notes, and snippets.

View kattrali's full-sized avatar

Delisa kattrali

View GitHub Profile
@kylef
kylef / dict.c
Created March 27, 2009 17:11
A key/value dictionary system in C
/* A key/value dict system in C */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define TEST TRUE /* Comment this line out to compile without a main function (used when including into another application). */
typedef struct dict_t_struct {
char *key;
void *value;
@kylef
kylef / Django HTCPCP Middleware.py
Last active November 25, 2015 01:09
A HTCPCP Implementation for Django
from random import randint
from django.http import HttpResponse
class HTCPCPMiddleware(object):
"""
This middleware allows a your django project to act as a HTCPCP (Hyper
Text Coffee Pot Control Protocol) server. If the user requests to BREW
a coffee, and it is not on the list. Then it will get a `406 Not
Acceptable`, and randomly it will respond with `418 I'm a teapot`.
#!/usr/bin/env ruby
STDIN.read.split("\n").each{ |line| puts line if (line =~ /CONFLICT/) }
@rheaton
rheaton / tracker_csv_export_to_pdf.rb
Created March 30, 2011 15:38
takes a csv file from tracker and makes story cards. be careful of the order when you are cutting them up.
#!/usr/bin/env ruby
# Script to generate PDF cards suitable for planning poker
# from Pivotal Tracker [http://www.pivotaltracker.com/] CSV export.
# Inspired by Bryan Helmkamp's http://github.com/brynary/features2cards/
# Example output: http://img.skitch.com/20100522-d1kkhfu6yub7gpye97ikfuubi2.png
require 'rubygems'
@shazron
shazron / gist:943736
Created April 27, 2011 04:55
About XCode 4 Project Template (How To Create Custom Project Template)
From: http://snipt.net/yonishin/about-xcode-4-project-template
XCode 4 Projects and Files Template Folder: /Developer/Library/Xcode/Templates
Examples:
/Developer/Library/Xcode/Templates/Project Templates/Base/Other/Empty.xctemplate
/Developer/Library/Xcode/Templates/Project Templates/Base/Base.xctemplate
/Developer/Library/Xcode/Templates/Project Templates/Mac/Mac Base.xctemplate
/Developer/Library/Xcode/Templates/Project Templates/Mac/Application/Command Line Tool.xctemplate
/Developer/Library/Xcode/Templates/Project Templates/Mac/Application/Cocoa Application.xctemplate
@kylef
kylef / PKGBUILD
Created July 5, 2011 17:41
lxc package for arch linux
pkgname=lxc
pkgver=0.7.4.2
pkgrel=1
pkgdesc="Linux Containers"
arch=('i686' 'x86_64')
url="http://lxc.sourceforge.net/"
depends=('bash' 'perl')
license=('LGPL')
source=("http://lxc.sourceforge.net/download/lxc/$pkgname-$pkgver.tar.gz" lxc.rcd lxc.confd)
md5sums=('36fcb0f6a39d2f55130421f342f24ef3' '520594461912e084c220ca37eb97afd2' 'efb0c46839136842e9d3617924a9b5b5')
@smellman
smellman / patch_for_config_mk_to_icu.diff
Created November 20, 2011 23:48
LuakitをMacOSXでビルドするためのパッチ
diff --git config.mk config.mk
index 8b453ec..d69b687 100644
--- config.mk
+++ config.mk
@@ -46,7 +46,7 @@ have lua >= 5.1 installed)
endif
# Packages required to build luakit
-PKGS := gtk+-2.0 gthread-2.0 webkit-1.0 javascriptcoregtk-1.0 sqlite3 $(LUA_PKG_NAME)
+PKGS := icu-i18n gtk+-2.0 gthread-2.0 webkit-1.0 javascriptcoregtk-1.0 sqlite3 $(LUA_PKG_NAME)
@rtgibbons
rtgibbons / VBoxReloadKext.sh
Created March 12, 2012 19:51 — forked from timdream/VBoxReloadKext.sh
Script: reload VirtualBox kernel extension in Mac OS X
#!/bin/bash
unload() {
kextstat | grep "org.virtualbox.kext.VBoxUSB" > /dev/null 2>&1 && sudo kextunload -b org.virtualbox.kext.VBoxUSB
kextstat | grep "org.virtualbox.kext.VBoxNetFlt" > /dev/null 2>&1 && sudo kextunload -b org.virtualbox.kext.VBoxNetFlt
kextstat | grep "org.virtualbox.kext.VBoxNetAdp" > /dev/null 2>&1 && sudo kextunload -b org.virtualbox.kext.VBoxNetAdp
kextstat | grep "org.virtualbox.kext.VBoxDrv" > /dev/null 2>&1 && sudo kextunload -b org.virtualbox.kext.VBoxDrv
}
load() {
@MaximKeegan
MaximKeegan / xcode_ramdisk.sh
Created April 12, 2012 03:28
Create a RAM disk for using with XCode
#!/bin/sh
# Create a RAM disk with same perms as mountpoint
# Script based on http://itux.idev.pro/2012/04/iservice-speed-up-your-xcode-%D0%BD%D0%B5%D0%BA%D0%BE%D1%82%D0%BE%D1%80%D1%8B%D0%B5-%D1%81%D0%BF%D0%BE%D1%81%D0%BE%D0%B1%D1%8B/ with some additions
# Usage: sudo ./xcode_ramdisk.sh start
USERNAME=$(logname)
TMP_DIR="/private/tmp"
RUN_DIR="/var/run"
SYS_CACHES_DIR="/Library/Caches"
@baroquebobcat
baroquebobcat / mirah_repl.rb
Created May 1, 2012 03:53
Mirah REPL -- hacked together
#
# Mirah REPL -- hacked to bits
#
# assuming your ruby is jruby,
# $ gem install mirah
# $ ruby -rubygems repl.rb
# m> class Foo
# m> def bar
# m> 12
# m> end