Skip to content

Instantly share code, notes, and snippets.

GLOBAL = 'main'
import foo
import types
def p(self, x):
return 'p: fixed ' + GLOBAL
foo.Parent.p = types.FunctionType(p.__code__, foo.Parent.p.im_func.__globals__, argdefs=foo.Parent.p.im_func.__defaults__)
import collections.abc
class ClassDict(collections.abc.MutableMapping):
''' Wrapper for cls.__dict__ that supports assignment.
'''
def __init__(self, cls):
self.cls = cls
self.dct = cls.__dict__
@o11c
o11c / .gitignore
Last active December 3, 2016 02:32
FreePascal cross hack (Debian packages)
/cache/
/tmp/
/out/
/fpc-cross-hack-config.sh
@o11c
o11c / foo.gdb
Last active November 11, 2016 04:59
Variables in GDB memory (without a running process)
#!/usr/bin/gdb -x
# Demonstration of manipulating variables without
# touching inferior memory at all.
# Harmless executable that everyone has
file /bin/true
# You probably don't have symbols from /bin/true itself though.
# So, run it once to get type symbols from shared libraries (libc).
@o11c
o11c / errors.txt
Last active November 3, 2016 01:21
Unhandled Error
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/twisted/python/log.py", line 101, in callWithLogger
return callWithContext({"system": lp}, func, *args, **kw)
File "/usr/lib/python3/dist-packages/twisted/python/log.py", line 84, in callWithContext
return context.call({ILogContext: newCtx}, func, *args, **kw)
File "/usr/lib/python3/dist-packages/twisted/python/context.py", line 118, in callWithContext
return self.currentContext().callWithContext(ctx, func, *args, **kw)
File "/usr/lib/python3/dist-packages/twisted/python/context.py", line 81, in callWithContext
return func(*args,**kw)
@o11c
o11c / LandscapeShader.glsl.diff
Created October 30, 2016 19:37
Bug in OpenClonk
diff --git a/planet/Graphics.ocg/LandscapeShader.glsl b/planet/Graphics.ocg/LandscapeShader.glsl
index fd26967..45bc358 100644
--- a/planet/Graphics.ocg/LandscapeShader.glsl
+++ b/planet/Graphics.ocg/LandscapeShader.glsl
@@ -100,6 +100,8 @@ slice(texture+4)
slice(material)
{
+ float fix1 = 0.5;
+ float fix2 = 0.5;
aarch64-elf
aarch64-linux-gnu
aarch64-rtems
alpha-linux-gnu
alpha-freebsd6
alpha-netbsd
alpha-openbsd
alpha64-dec-vms
alpha-dec-vms
am33_2.0-linux
--- Process 289 created
--- Process 289 loaded (unknown) at 7B410000
--- Process 289 loaded (unknown) at 7BC10000
--- Process 289 loaded \??\C:\cygwin\bin\cygwin1.dll at 61000000
--- Process 289 loaded \??\C:\cygwin\bin\cygiconv-2.dll at 6F7E0000
--- Process 289 loaded \??\C:\cygwin\bin\cygintl-8.dll at 6F780000
29 29 [main] gcc (289) **********************************************
394 423 [main] gcc (289) Program name: C:\cygwin\bin\gcc.exe (windows pid 289)
256 679 [main] gcc (289) OS version: Windows NT-5.1
251 930 [main] gcc (289) **********************************************
# TODO: variants of non-alphanumerics, greek letters, and others
!"#$%&'()*+,-./⓿❶❷❸❹❺❻❼❽❾:;<=>?@🅐🅑🅒🅓🅔🅕🅖🅗🅘🅙🅚🅛🅜🅝🅞🅟🅠🅡🅢🅣🅤🅥🅦🅧🅨🅩[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ # BlackCircle
!"#$%&'()*+,-./0123456789:;<=>?@🅰🅱🅲🅳🅴🅵🅶🅷🅸🅹🅺🅻🅼🅽🅾🅿🆀🆁🆂🆃🆄🆅🆆🆇🆈🆉[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ # BlackSquare
!"#$%&'()*+,-./𝟎𝟏𝟐𝟑𝟒𝟓𝟔𝟕𝟖𝟗:;<=>?@𝐀𝐁𝐂𝐃𝐄𝐅𝐆𝐇𝐈𝐉𝐊𝐋𝐌𝐍𝐎𝐏𝐐𝐑𝐒𝐓𝐔𝐕𝐖𝐗𝐘𝐙[\]^_`𝐚𝐛𝐜𝐝𝐞𝐟𝐠𝐡𝐢𝐣𝐤𝐥𝐦𝐧𝐨𝐩𝐪𝐫𝐬𝐭𝐮𝐯𝐰𝐱𝐲𝐳{|}~ # Bold
!"#$%&'()*+,-./0123456789:;<=>?@𝕬𝕭𝕮𝕯𝕰𝕱𝕲𝕳𝕴𝕵𝕶𝕷𝕸𝕹𝕺𝕻𝕼𝕽𝕾𝕿𝖀𝖁𝖂𝖃𝖄𝖅[\]^_`𝖆𝖇𝖈𝖉𝖊𝖋𝖌𝖍𝖎𝖏𝖐𝖑𝖒𝖓𝖔𝖕𝖖𝖗𝖘𝖙𝖚𝖛𝖜𝖝𝖞𝖟{|}~ # BoldFraktur
socket_structs
*.o