Skip to content

Instantly share code, notes, and snippets.

View Dav1dde's full-sized avatar

David Herberth Dav1dde

View GitHub Profile
@Dav1dde
Dav1dde / orderbuf.py
Last active December 10, 2015 02:09
A python plugin for weechat to order buffers
import weechat as w
from collections import defaultdict
from itertools import chain
import sys
NAME = 'orderbuf'
DESC = 'Orders buffers like a boss. Orders by channel, server, prefixed channel, ' \
'autojoin list and in reverse order.'
#!/usr/bin/python
# -*- coding: utf-8 -*-
from string import ascii_lowercase
char_order_de = ['e', 'n', 'i', 'r', 's', 'a', 't', 'd', 'h', 'u', 'l', 'g',
'o', 'c', 'm', 'b', 'f', 'w', 'k', 'z', 'p', 'v', 'j', 'y', 'x', 'q']
char_order_en = ['e', 't', 'a', 'o', 'i', 'n', 's', 'r', 'h', 'l', 'd', 'c',
update_interval 0.5
background yes
own_window yes
own_window_type override
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
draw_shades no
draw_outline no
draw_borders no
border_inner_margin 2
@Dav1dde
Dav1dde / rmbridge.lua
Created December 16, 2012 11:56
This is a program for ComputerCraft which digs a one wide hole (or removes a one wide bridge)
function refuel()
local fueled = false
for i=12,16 do
turtle.select(i)
fueled = turtle.refuel()
end
return fueled
end
@Dav1dde
Dav1dde / bridge.lua
Created December 15, 2012 20:07
This is a program for ComputerCraft, it tells the turtle to build a one wide bridge
function refuel()
local fueled = false
for i=12,16 do
turtle.select(i)
fueled = turtle.refuel()
end
return fueled
end
(steam:9182): Gtk-WARNING **: A floating object was finalized. This means that someone
called g_object_unref() on an object that had only a floating
reference; the initial floating reference is not owned by anyone
and must be removed with g_object_ref_sink().
System startup time: 11,76 seconds
File "/home/dav1d/Steam/ubuntu12_32/driverhelper.py", line 356
print json.dumps(pkgInfo.getInfo())
^
SyntaxError: invalid syntax
In [1]: class X(object):
...: def __init__(self): pass
...: def foo(self):
...: return "XXX"
...:
In [2]: x = X()
In [3]: '{self.foo} {self.foo()}'.format(self=x)
---------------------------------------------------------------------------

Minecraft Encryption with OpenSSL

Definitions

pk = Public Key, sent with the EncryptionKeyRequest

vt = Verify Token, sent unecrypted with the EncryptionKeyRequest

ss = Shared Secret, generated by the client, 16 random bytes

@Dav1dde
Dav1dde / gist:3788166
Created September 26, 2012 13:50 — forked from anonymous/gist:3788098
DasIch... Tutorials yummy yummy
class AB():
def function1(self, eingabe):
print(eingabe)
tokenDict = {'vE':function1}
a = AB()
test = a.tokenDict['vE']
0000 002 02 .
0000 039 27 .
0000 000 008 00 08 . .
0000 000 122 00 7A . z
0000 000 101 00 65 . e
0000 000 110 00 6E . n
0000 000 115 00 73 . s
0000 000 049 00 31 . 1
0000 000 101 00 65 . e