Skip to content

Instantly share code, notes, and snippets.

Joe Alcorn joealcorn

Block or report user

Report or block joealcorn

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@joealcorn
joealcorn / file.py
Created Feb 16, 2017
PicklableFile implementation
View file.py
from StringIO import StringIO
class UnpickledStringIO(StringIO):
def __setstate__(self, state):
self.__dict__.update(state)
def unpickle_factory(*a, **kw):
return UnpickledStringIO(*a, **kw)
View branch.sql
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;
View Preferences.sublime-settings
{
"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": "<",
View mcdowntime.py
#!/usr/bin/env python
"""
Networking stuff is cribbed from here
https://gist.github.com/barneygale/5051791
This is just a gevent ports
"""
import optparse
@joealcorn
joealcorn / mcbouncer.py
Last active Oct 8, 2015
wrapper for MCBouncer API
View mcbouncer.py
import requests
try:
import simplejson as json
except ImportError:
import json
class MCBouncer(object):
"""
MCBouncer object allowing you to interact with the API.
@joealcorn
joealcorn / mcbouncer_ban_import.py
Created Mar 11, 2012
for importing bans from banned-players.txt
View mcbouncer_ban_import.py
#! /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
You can’t perform that action at this time.