Skip to content

Instantly share code, notes, and snippets.

@reuben
reuben / extension.cpp
Created June 6, 2011 22:46
VIPER, Y U NO SCAN SIGNATURE
#else /* !WIN32 */
/* We must load in the binary to allow access to it.
* Thanks to your-name-here for that bit of info!
*/
if (dlopen("libpython2.5.so.1.0", RTLD_NOW) == NULL)
{
strncpy(error, "Unable to load libpython2.5.so.1.0", maxlength);
return false;
}
@reuben
reuben / Client.groovy
Created June 10, 2011 12:28
Actor-like syntax for ZMQ sockets in Groovy
import org.zeromq.ZMQ;
import org.zeromq.ZMQActor;
class Player extends ZMQActor {
String name
int myNum
public Player(ZMQ.Context ctx, String addr, String name) {
super(ctx, ZMQ.REQ)
this.name = name
@reuben
reuben / pbcmd.cpp
Created November 30, 2011 00:48
pbcmd fix
/*
* Copyright (C) 2011 James Geboski <jgeboski@gmail.com>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published
* by the Free Software Foundation.
*/
#include "Chan.h"
#include "Client.h"
@reuben
reuben / prowl.cpp
Created November 30, 2011 01:03
prowl fix
/*
* Copyright (C) 2009 flakes @ EFNet
* tweaked by Gm4n @ freenode
* Version 0.9.5-2 (2009-11-9)
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published
* by the Free Software Foundation.
*/
@reuben
reuben / bla.cpp
Created January 15, 2012 01:53
testing sublime text gist plugin
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* vim: set sw=4 ts=8 et tw=78:
@reuben
reuben / zmqsubscriber.cpp
Created May 19, 2012 19:52
0MQ subscriber code for a Triskle client
/*
* vim: set ts=4 :
* =============================================================================
* Triskle Commons
* Copyright (C) 2011 Reuben 'Seta00' Morais. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, version 3.0, as published by the
* Free Software Foundation.
@reuben
reuben / privatepaste.py
Created June 24, 2012 17:29
Custom privatepaste.py that only outputs the paste URL to stdout
#!/usr/bin/env python
# vim: sw=4 ts=4 expandtab smarttab
"""
Private Paste Command Line Utility
privatepaste.com
@author Adrian <adrian@planetcoding.net>
@since 2010-04-11
"""
@reuben
reuben / osx.patch
Last active December 31, 2022 15:13
FoFiX OS X build
mkvirtualenv fofix -p /usr/bin/python2.6
workon fofix
brew install sdl
brew install sdl_{mixer,ttf,image}
brew install libpng
cd /usr/local/include
ln -s SDL/* .
pip install hg+http://bitbucket.org/pygame/pygame
pip install PyOpenGL
pip install numpy
dictionary ContactFindSortOptions {
DOMString sortBy;
DOMString sortOrder = "ascending";
};
dictionary ContactFindOptions : ContactFindSortOptions {
DOMString filterValue;
DOMString filterOp;
any filterBy; // e.g. ["givenName", "nickname"]
unsigned long filterLimit;
receiveMessage: function(aMessage) {
let msg = aMessage.json;
switch (aMessage.name) {
case "Contact:Changed":
// Fire oncontactchange event
if (DEBUG) debug("Contacts:ContactChanged: " + msg.contactID + ", " + msg.reason);
let event = new this._window.MozContactChangeEvent("contactchange", {
contactID: msg.contactID,
reason: msg.reason