Install ImageMagick for image conversion:
brew install imagemagick
Install tesseract for OCR:
brew install tesseract --all-languages
Or install without --all-languages
and install them manually as needed.
from django.core.cache import cache | |
from django.http import HttpResponseForbidden | |
from functools import wraps | |
from django.utils.decorators import available_attrs | |
def ratelimit(limit=10,length=86400): | |
""" The length is in seconds and defaults to a day""" | |
def decorator(func): | |
def inner(request, *args, **kwargs): | |
ip_hash = str(hash(request.META['REMOTE_ADDR'])) |
// | |
// ZbarPlug.h | |
// Phun | |
// | |
// Created by Jeff Lee on 12/12/10. | |
// Copyright 2010 __MyCompanyName__. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> | |
#import <UIKit/UIKit.h> |
;(function($){ | |
ListFilterCollapsePrototype = { | |
bindToggle: function(){ | |
var that = this; | |
this.$filterEl.click(function(){ | |
that.$filterList.slideToggle(); | |
}); | |
}, | |
init: function(filterEl) { | |
this.$filterEl = $(filterEl).css('cursor', 'pointer'); |
easterEgg.BadWorder.list={ | |
"4r5e":1, | |
"5h1t":1, | |
"5hit":1, | |
a55:1, | |
anal:1, | |
anus:1, | |
ar5e:1, | |
arrse:1, | |
arse:1, |
Install ImageMagick for image conversion:
brew install imagemagick
Install tesseract for OCR:
brew install tesseract --all-languages
Or install without --all-languages
and install them manually as needed.
L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns
Compress 1K bytes with Zippy ............. 3,000 ns = 3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns = 20 µs
SSD random read ........................ 150,000 ns = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs
from project.utils import classmaker | |
class Category(TranslatableModel, MPTTModel): | |
# https://github.com/ojii/django-nani/issues/39 | |
__metaclass__ = classmaker() | |
# Example usage... | |
from admin_util import ImprovedModelForm | |
class DialogAdmin(ImprovedModelForm): | |
raw_id_fields = ("forum", "user", ...) # "forum" and "user" are ForeignKeys | |
... |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2012 Brandon B. [email protected]
Everyone is permitted to copy and distribute verbatim or modified copies of this license document, and changing it is allowed as long as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
from django.db import connection | |
from django.conf import settings | |
cursor = connection.cursor() | |
cursor.execute('SHOW TABLES') | |
results=[] | |
for row in cursor.fetchall(): | |
results.append(row) | |
for row in results: | |
cursor.execute('ALTER TABLE %s CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;' % (row[0])) |