Skip to content

Instantly share code, notes, and snippets.

@FugiTech
FugiTech / blaseball.user.js
Last active March 28, 2024 14:40
Two column blaseball layout
// ==UserScript==
// @name Blaseball
// @namespace http://tampermonkey.net/
// @version 0.2
// @description Two column blaseball layout
// @author Fugi
// @match https://blaseball.com/*
// @grant none
// ==/UserScript==

Keybase proof

I hereby claim:

  • I am fugiman on github.
  • I am fugi (https://keybase.io/fugi) on keybase.
  • I have a public key whose fingerprint is 282B FAB3 7180 A044 AC67 A8E0 B79C 8D27 2F32 2CEA

To claim this, I am signing this object:

@FugiTech
FugiTech / transfer.py
Created May 4, 2013 01:48
Moves data from a SQL table to MongoDB
from twisted.enterprise import adbapi
from twisted.internet import reactor, defer
import txmongo, sys, random
bottom = int(sys.argv[1]) if len(sys.argv) > 1 else 0
mongo = txmongo.lazyMongoConnectionPool().DATABASE.COLLECTION
sql = adbapi.ConnectionPool(LIBRARY, host=HOST, port=PORT, db=DATABASE, user=USER, passwd=PASS, cp_reconnect=True)
@defer.inlineCallbacks
def main():
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from twisted.internet defer
from functools import wraps
import json
def writeJSON(fn):
@wraps(fn)
def wrapped(request, *params, **kwargs):
@FugiTech
FugiTech / attack.py
Created October 10, 2012 15:19
txircd load testing script using BeesWithMachineGuns
# -*- coding: utf-8 -*-
from twisted.internet import reactor, ssl
from twisted.internet.protocol import ClientFactory
from twisted.words.protocols.irc import IRCClient
import random, string
def genMessage(low, high):
l = random.randint(low, high)
return "".join([random.choice(string.letters + string.digits + string.punctuation + ' ') for _ in xrange(l)])
@FugiTech
FugiTech / proxy.py
Created July 12, 2012 11:04
Simple SockJS-TCP proxy in Twisted Python
from twisted.internet import reactor
from twisted.protocols.portforward import ProxyFactory
from txsockjs.factory import SockJSMultiFactory
pf = ProxyFactory('host', port)
ws = SockJSMultiFactory()
ws.addFactory(pf, "proxy")
reactor.listenTCP(8000, ws)
reactor.run()