Skip to content

Instantly share code, notes, and snippets.

@agrif
agrif / demo.c
Created September 25, 2011 20:27
a simple demo of loading block data with libredstone
#include <libredstone/redstone.h>
int main(int argc, char* argv[])
{
RSRegion* region = rs_region_open("path/to/regions/r.0.0.mcr", false);
if (!region)
{
/* file didn't load... */
return 1;
}
@agrif
agrif / gist:1283086
Created October 13, 2011 01:07
bukkit error
21:03:11 [INFO] Loaded EssentialsProtect build 2.6.2 by: essentials team
21:03:11 [INFO] Loaded EssentialsChat build 2.6.2 by: essentials team
21:03:11 [INFO] Loaded EssentialsSpawn build 2.6.2 by: essentials team
21:03:11 [INFO] Server permissions file permissions.yml is empty, ignoring it
21:03:11 [INFO] Done (1.604s)! For help, type "help" or "?"
21:03:26 [SEVERE] java.io.InterruptedIOException: Operation interrupted
21:03:26 [SEVERE] at java.net.SocketInputStream.socketRead0(Native Method)
21:03:26 [SEVERE] at java.net.SocketInputStream.read(SocketInputStream.java:129)
21:03:26 [SEVERE] at java.net.SocketInputStream.read(SocketInputStream.java:182)
21:03:26 [SEVERE] at java.io.FilterInputStream.read(FilterInputStream.java:66)
devel/android/Gargoyle
devel/emacs/pianobar.el
devel/emacs/sourcepawn-mode
devel/experiments/area53
devel/experiments/caduceus
devel/experiments/dev-four
devel/experiments/libisp
devel/experiments/MappaTerraria
devel/experiments/rail-shooter-cogl
devel/experiments/uclisp
# colors.py
import copy
import platform
import sys
# basic color definitions
BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = range(8)
# default values
#include <stdio.h>
@myfor(statement initializer; expression condition; statement increment)
{
initializer;
while (condition)
{
block;
increment;
}
#!/usr/bin/python
import ctypes
import ctypes.util
rs = ctypes.CDLL("libredstone.dylib")
c = ctypes.CDLL(ctypes.util.find_library("c"))
c.fdopen.restype = ctypes.c_void_p
c.fdopen.argtypes = [ctypes.c_int, ctypes.c_char_p]
Python 2.6.6 (r266:84292, May 28 2011, 19:49:25)
[GCC 4.2.1 (Apple Inc. build 5664)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import redstone as rs
>>> n = rs.NBT.parse_from_file("level.dat")
>>> for x in n.find("Pos"):
... print x.float
...
14.6386233054
83.6200000048
import sys
import redstone as rs
for name in sys.argv[1:]:
print "Inspecting %s" % name
region = rs.Region.open(name)
for x in range(32):
for z in range(32):
if region.contains_chunk(x, z):
chunk = rs.NBT.parse_from_region(region, x, z)
typedef struct
{
int a;
int b;
const char* str;
} RSThingy;
/* ... */
RSThingy thingy = {
agrif@anduril:~$ ssh flexy env
SHELL=/bin/sh
SSH_CLIENT=192.168.1.130 58557 22
USER=mobile
MAIL=/var/mail/mobile
PATH=/usr/bin:/bin:/usr/sbin:/sbin
PWD=/private/var/mobile
SHLVL=1
HOME=/var/mobile
LOGNAME=mobile