Skip to content

Instantly share code, notes, and snippets.

@joealcorn
joealcorn / mcbouncer_ban_import.py
Created March 11, 2012 16:45
for importing bans from banned-players.txt
#! /usr/bin/env python
'''
No values are url encoded so will fail if any spaces/special chars exist
apikey and pathToBanList need to be changed, the rest will work as-is
'''
import urllib2
@joealcorn
joealcorn / mcbouncer.py
Last active October 8, 2015 14:18
wrapper for MCBouncer API
import requests
try:
import simplejson as json
except ImportError:
import json
class MCBouncer(object):
"""
MCBouncer object allowing you to interact with the API.
#!/usr/bin/env python
"""
Networking stuff is cribbed from here
https://gist.github.com/barneygale/5051791
This is just a gevent ports
"""
import optparse
{
"auto_complete": true,
"auto_complete_commit_on_tab": false,
"auto_complete_delay": 50,
"auto_complete_selector": "source - comment",
"auto_complete_size_limit": 4194304,
"auto_complete_triggers":
[
{
"characters": "<",
BEGIN;
CREATE TYPE usage_type AS ENUM ('notifications', 'gravatar', 'paypal');
CREATE TYPE email_address_with_confirmation AS
(
address text,
confirmed boolean
);
ALTER TABLE participants ADD email_notifications email_address_with_confirmation DEFAULT NULL;
ALTER TABLE participants ADD email_gravatar email_address_with_confirmation DEFAULT NULL;
@joealcorn
joealcorn / file.py
Created February 16, 2017 17:19
PicklableFile implementation
from StringIO import StringIO
class UnpickledStringIO(StringIO):
def __setstate__(self, state):
self.__dict__.update(state)
def unpickle_factory(*a, **kw):
return UnpickledStringIO(*a, **kw)