Skip to content

Instantly share code, notes, and snippets.

View rsms's full-sized avatar

Rasmus rsms

View GitHub Profile
{
"spot_categories": [
{
"name": "Architecture & Buildings",
"image_url": "http://static.gowalla.com/categories/13-standard.png",
"url": "/categories/13",
"spot_categories": [
{
"name": "Bridge",
"image_url": "http://static.gowalla.com/categories/128-standard.png",
@rsms
rsms / spotlight-ax.m
Created May 10, 2009 16:45 — forked from liesen/gist:109666
A small utility that observes any changes of a search field of a given application
/* Cocoa accessibility framework for intercepting Spotlight user input. */
#import <Cocoa/Cocoa.h>
#import <AppKit/NSAccessibility.h>
static CFStringRef kSpotlightBundleIdentifier = CFSTR("com.apple.spotlight");
static void SpotlightCallback(AXObserverRef observer,
AXUIElementRef element,
@rsms
rsms / gist:58576
Created February 5, 2009 06:38 — forked from khafatech/gist:58553
"Calculates the binary huffman code for the given characters and their frequencies."
from copy import copy
freqs = {'a': 20, 'b': 10, 'c': 12, 'd': 5, 'e': 15, 'z': 65 }
class Node:
def __init__(self, ch='', freq=-1, code=None):