Skip to content

Instantly share code, notes, and snippets.

View seebs's full-sized avatar

seebs seebs

View GitHub Profile
diff --git a/src/moai-sim/MOAIParticlePexPlugin.cpp b/src/moai-sim/MOAIParticlePexPlugin.cpp
index f2b556a..32c5015 100644
--- a/src/moai-sim/MOAIParticlePexPlugin.cpp
+++ b/src/moai-sim/MOAIParticlePexPlugin.cpp
@@ -752,6 +752,8 @@ void MOAIParticlePexPlugin::_renderRadialScript( float* particle, float* registe
sprite->mXLoc = particle[ MOAIParticle::PARTICLE_X ];
sprite->mYLoc = particle[ MOAIParticle::PARTICLE_Y ];
+ sprite->mGfxID = 1;
+
local passnouns = { 'Loc', 'Rot', 'Scl', 'Color' }
local anim_safe_data = {}
setmetatable(anim_safe_data, { __mode = 'k' })
local animverbs = { 'seek', 'move' }
function Util.animsafe(obj)
if anim_safe_data[obj] then
return
end
local d = {}
@seebs
seebs / gist:7171ed661c47c5dc24ec
Created October 24, 2014 07:12
another crash dump
---- Minecraft Crash Report ----
// Hey, that tickles! Hehehe!
Time: 10/24/14 1:59 AM
Description: Ticking block entity
java.lang.ArrayIndexOutOfBoundsException: 5
at thaumcraft.common.tiles.TileTubeBuffer.getSuctionAmount(TileTubeBuffer.java:166)
at thaumcraft.common.tiles.TileTubeBuffer.fillBuffer(TileTubeBuffer.java:233)
at thaumcraft.common.tiles.TileTubeBuffer.func_145845_h(TileTubeBuffer.java:219)
@seebs
seebs / gist:bee7f16238782adc05b4
Created May 15, 2015 21:28
round function test case (from IRC discussion)
local floor = math.floor
function rd(x, d)
return floor(x * d * 10) / (d * 10)
end
function tst(x, d)
local r = rd(x, d)
print(string.format("rd(%s, %s) => %s", tostring(x), tostring(d), tostring(r)))
end
tst(0.40, 1)
tst(0.35, 1)
# Ugh!
from commands import *
import sys
class Test(object):
def __getattr__(self, name):
return self
def __call__(*args):
r = ""; l = long("1ye7arur2v2r9jacews0tuy9fe8eu8fcva4eh", 36)
while l: r += chr(l&127); l >>= 7
#!/bin/sh
for subdir in *; do
mkdir -p "resorted"
for subsubdir in $subdir/*/; do
subsub=${subsubdir#*/}
mkdir -p resorted/$subsub
mv $subsubdir resorted/$subsub/$subdir
done
rm -r $subdir
done
#!/usr/bin/python2
import pymclevel
import sys
print "Loading world..."
level = pymclevel.loadWorld('/home/seebs/src/mcaedit/world')
print "Loaded."
def has_object(chunk, id):
/*
* SK's Minecraft Launcher
* Copyright (C) 2010-2014 Albert Pham <http://www.sk89q.com> and contributors
* Please see LICENSE.txt for license information.
*/
package com.skcraft.launcher.util;
import javax.swing.*;
import javax.swing.event.DocumentEvent;
int elements = root.getElementCount();
int excess = elements - maximumLines;
if (excess > 0) {
if (isRemoveFromStart) {
root.replace(0, excess, new Element[0]);
} else {
root.replace(elements - excess, excess, new Element[0]);
}
}
}
Inserting 99 bytes of text at offset 2322.
>removeLines
>removeFromStart(1 excess)
rFS: excess 1, element is 0-119, new count 27/25
<removeFromStart(1 excess)
After removing lines (26), still have 27/25 lines.
<removeLines
[19:03:06] [Client thread/INFO] [WAILA Plugins]: Attempting to load plugin for harvestcraft.
Inserting 94 bytes of text at offset 2302.
[19:03:06] [Client thread/INFO] [WAILA Plugins]: Successfully loaded plugin for harvestcraft.