Skip to content

Instantly share code, notes, and snippets.

View pskupinski's full-sized avatar

Preston Skupinski pskupinski

  • LockerDome
  • Austin, TX
View GitHub Profile
@pskupinski
pskupinski / perpetual_day.patch
Created April 3, 2011 23:06
A patch that keeps the server always at full daylight, but doesn't break redstone related code as well.
--- disassembled/cw.j 2011-04-01 15:35:10.894581873 -0400
+++ modded_asm/cw.j 2011-04-03 19:09:03.546031504 -0400
@@ -6912,16 +6912,26 @@
lreturn
.end method
-.method public l()J
+; Redstone code and anything not night/day related gets to use this special
+; function, so they don't break as well.
+.method public ll()J
@pskupinski
pskupinski / C++0x_Maybe_Monad.cpp
Created March 13, 2011 04:57
My maybe monad implementation in C++0x.
// This code is in the public domain, feel free to use it in anyway you'd
// like to.
#include <iostream>
#include <functional>
using namespace std;
template<class A>
class Maybe {
protected:
A a;
import javax.script._
import org.python.core._
import org.python.util._
import java.util.List
def pythonInterpreterTest {
val interp = new PythonInterpreter
interp.exec("commandList = [\"meh\"]")
val pyObj = interp.get("commandList")
val jObj = pyObj.__tojava__(classOf[Object])
import scala.actors._
import Actor._
import org.python.core._
import org.python.util._
/**
* A hack to avoid Jython throwing up from trying to use a method named !.
*/
def send(a: Actor, msg: Any) {
a ! msg
/*
* Copyright (c) 2010, Preston Skupinski <[email protected]>
*
* 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