Skip to content

Instantly share code, notes, and snippets.

CREATE
PROCEDURE `sp_dev_re_guid`()
BEGIN
/**
* DEGREE: UTILITY
* TABLES AFFECT: any with creature.guid value in use
*
* THIS PROCEDURE IS IN A TESTING PHASE, USE AT OWN RISK!
*
* ex: CALL `sp_dev_re_guid`(1000); -- will renumber all existing guids in creature table starting with 1000 as initial
(lambda n,s,I:n.classobj('h',(),dict(__init__=(lambda M,S,P,C:M.__dict__.update(
dict(R=(S,P),H=C,O=s.socket()))),C=(lambda M:(M.O.connect(M.R),setattr(M,'D',M.O
.makefile()),setattr(M,'S',(lambda l: M.O.send('%s\r\n'%l))),M.S("NICK hue"),M.S
("USER a b c d :LOL!"),setattr(M,'R',lambda n,m: M.S('PRIVMSG %s :%s'%(n,m))),M.
P())),G = (lambda M,S:S.split(' :',1)[1] if' :'in S else ''),P=(lambda M:next(I.
dropwhile((lambda Lu:((lambda L:((lambda: M.S("PONG :%s"%M.G(L))if L.startswith(
'PING')else(lambda P,G,S:({'001':(lambda: M.S('JOIN %s'%M.H)),'PRIVMSG':(lambda:
M.HC(L[1:].split('!',1),P[2],G[1:].split(),G)if G.startswith('!')else None)}.get
(P[1],lambda: None)())if len(P)>1 else None)(L.split(),M.G(L),M.O))()))(Lu.strip
()),True)[1]),iter(M.D)),None)),HC=(lambda M,(N,H),C,P,L: {'hello':lambda:M.R(C,
@e000
e000 / lol.pl
Created November 2, 2011 04:52
s..[){+[^{}.;y.{+}^)[. \-\/fmr.;qx.$_.;
# How it works
s..[){+[^{}.; # defines $_ as "[){+[^{}."
y.{+}^)[. \-\/fmr.; # translates
print $_;
# "{" = " "
# "+" = "-"
# "}" = "/"
from twisted.internet import protocol, reactor
from twisted.web import static, server, proxy
from twisted.web.resource import Resource
import base64, urllib
#from os import fork, setsid, umask, dup2
from sys import stdin, stdout, stderr
from os import getpid
from urllib import quote as urlquote
pid_file = "/home/tahoe/gateway/gateway.pid"
from twisted.internet import protocol, reactor
from twisted.web import static, server, proxy
from twisted.web.resource import Resource
import base64, urllib
#from os import fork, setsid, umask, dup2
from sys import stdin, stdout, stderr
from os import getpid
from urllib import quote as urlquote
pid_file = "/home/tahoe/gateway/gateway.pid"
@e000
e000 / donotuse.py
Created June 13, 2011 23:30
How to NEVER use lambdas.
##########################################################
# How to NEVER use Lambdas. An inneficient and yet educa-#
# tonal guide to the proper misuse of the lambda constru-#
# ct in Python 2.x. [DO NOT USE ANY OF THIS EVER] #
# by: e000 (13/6/11) #
##########################################################
## Part 1. Basic LAMBDA Introduction ##
# Well, it's worth diving straight into what lambdas are.
# Lambdas are pretty much anonymous "one line" functions
@e000
e000 / lambda.py
Created June 13, 2011 23:24
How to NOT use Lambdas
########################################################
# How to NOT use Lambdas. An inneficient and yet educa-#
# tonal guide to the proper misuse of the lambda const-#
# ruct in Python 2.x. DO NOT USE ANY OF THIS EVER #
# by: e000 (13/6/11) #
########################################################
## Part 1. Basic LAMBDA Introduction ##
# Well, it's worth diving straight into what lambdas are.
# Lambdas are pretty much annymous "one line" functions
@e000
e000 / lolambda.py
Created June 13, 2011 22:40
How not to use lambdas.
class Foo:
def __init__(self, a, b, c):
self._a = a
self._b = b
self._c = c
def getA(self):
return self._a
from Core.ZalgoUtil.CancellableClient import getPage
from twisted.python.util import OrderedDict
from urllib import quote
from hashlib import md5
from Core.ZalgoUtil.ModUtil import xhtml_unescape, utf8
import re
class AlreadyRunningError(Exception):
pass
@e000
e000 / str2bin.js
Created April 7, 2011 03:39
so many shitty str -> binary converters out there. here's a decent one.
strToBin = (function() {
var binarr = [] // build an array to hold the binary form of 0-255
for(var i = 0; i < 256; i++) {
bins = ''
for(var j = 7; j >= 0; j--) {
c = Math.pow(2, j)
bins += (i & c) == c ? '1' : '0'
}
binarr.push(bins)
}