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 | |
# -*- coding: utf-8 -*- | |
""" | |
fabfile for Django | |
------------------ | |
see http://morethanseven.net/2009/07/27/fabric-django-git-apache-mod_wsgi-virtualenv-and-p/ | |
modified for fabric 0.9/1.0 by Hraban (fiëé visuëlle) | |
several additions, corrections and customizations, too |
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 | |
#A simple script to automatically commit changes in script's directory at a specified interval. I use this mainly for document versioning. | |
import subprocess, time, os, datetime, sys | |
#Change this variable to set a different commit interval | |
interval = 300 # secs |
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 os | |
from os.path import join | |
from PIL import Image | |
#print os.path.dirname(__file__) | |
for current_directory, sub_directories, files in os.walk('.'): | |
#print "Current directory", current_directory | |
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 os | |
from os.path import join | |
from PIL import Image | |
#This script walks through subdirectories, checks if image is valid and if it is, saves the image in JPG format with quality setting of 65 | |
for root, dirs, files in os.walk('.'): | |
#print "Current directory", root | |
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
#!/bin/sh | |
# | |
# Script to run innobackupex script (for all databases on server), check for success, and apply logs to backups. | |
# | |
# (C)2010 Owen Carter @ Mirabeau BV | |
# This script is provided as-is; no liability can be accepted for use. | |
# You are free to modify and reproduce so long as this attribution is preserved. | |
# | |
INNOBACKUPEX=innobackupex-1.5.1 |
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 http://www.phpied.com/non-onload-blocking-async-js/ | |
(function(url){ | |
var iframe = document.createElement('iframe'); | |
(iframe.frameElement || iframe).style.cssText = "width: 0; height: 0; border: 0"; | |
var where = document.getElementsByTagName('script'); | |
where = where[where.length - 1]; | |
where.parentNode.insertBefore(iframe, where); | |
var doc = iframe.contentWindow.document; | |
doc.open().write('<body onload="'+ |
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
{ | |
"device_parsers": [ | |
{ | |
"device_replacement": "HTC $1", | |
"regex": "HTC ([A-Z][a-z0-9]+) Build" | |
}, | |
{ | |
"device_replacement": "HTC $1", | |
"regex": "HTC ([A-Z][a-z0-9 ]+) \\d+\\.\\d+\\.\\d+\\.\\d+" | |
}, |
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 __future__ import with_statement | |
import sys | |
import django | |
from django.core.management.base import BaseCommand | |
from django.utils.log import getLogger | |
class LoggingBaseCommand(BaseCommand): | |
# A subclass of BaseCommand that logs errors to django.commands |
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 gevent import monkey | |
monkey.patch_socket() | |
import gevent.pool | |
import os | |
import signal | |
import random | |
import time | |
import datetime | |
from multiprocessing import Semaphore, Array |
OlderNewer