Skip to content

Instantly share code, notes, and snippets.

View seebs's full-sized avatar

seebs seebs

View GitHub Profile
#!/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
# 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
@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)
@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)
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 = {}
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;
+