Watchers per repo, for each of my repos. Note: The GitHub API only lets me get the first few repos, so the list is incomplete.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import os | |
try: | |
from setuptools import setup, find_packages | |
except ImportError: | |
from distutils.core import setup | |
from distutils.util import convert_path | |
def _find_packages(where='.', exclude=()): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <objc/runtime.h> | |
static void SwizzleClassMethod(Class klass, SEL original, SEL new) | |
{ | |
Method origMethod = class_getClassMethod(klass, original); | |
Method newMethod = class_getClassMethod(klass, new); | |
if (class_addMethod(klass, original, method_getImplementation(newMethod), method_getTypeEncoding(newMethod))) { | |
class_replaceMethod(klass, new, method_getImplementation(origMethod), method_getTypeEncoding(origMethod)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Bless a certain initializer at compile time | |
// | |
// Sample usage: | |
// - (instancetype)initWithObject:(id)object | |
// - (instancetype)init ECDesignatedInitializer(initWithObject:); | |
// | |
#define ECDesignatedInitializer(__SEL__) __attribute__((unavailable("Invoke the designated initializer `" # __SEL__ "` instead."))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from threading import local | |
_blah = local() | |
class StopThatShit(Exception): | |
pass | |
def patch(): | |
from django.db.backends import util | |
from django import template |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import datetime | |
from south.db import db | |
from south.v2 import DataMigration | |
from django.db import models | |
class Migration(DataMigration): | |
def forwards(self, orm): | |
db.execute('UPDATE auth_user SET password=CONCAT("bcrypt", SUBSTR(password, 3)) WHERE password LIKE "bc$%%"') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import xmlrpclib | |
import pip | |
import argparse | |
from pkg_resources import parse_version | |
def version_number_compare(version1, version2): | |
return cmp(parse_version(version1), parse_version(version2)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def reexec(self): | |
"""\ | |
Relaunch the master and workers. | |
""" | |
self.kill_workers(signal.SIGQUIT) | |
fds = [l.fileno() for l in self.LISTENERS] | |
os.environ['GUNICORN_FD'] = ",".join([str(fd) for fd in fds]) | |
os.chdir(self.START_CTX['cwd']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[streeter@mail]:~$ source /usr/local/bin/virtualenvwrapper.sh | |
Traceback (most recent call last): | |
File "/usr/lib/python2.6/logging/handlers.py", line 72, in emit | |
self.doRollover() | |
File "/usr/lib/python2.6/logging/handlers.py", line 129, in doRollover | |
os.rename(self.baseFilename, dfn) | |
OSError: [Errno 13] Permission denied | |
Traceback (most recent call last): | |
File "/usr/lib/python2.6/logging/handlers.py", line 71, in emit | |
if self.shouldRollover(record): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Queries the slow_log database table maintained by Amazon RDS and outputs | |
it in the normal MySQL slow log text format for parsing by mk-query- | |
digest. | |
""" | |
import argparse | |
import _mysql |