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 redis import Redis | |
from rq import Queue | |
def func(): | |
queue = Queue('default', connection=Redis()) | |
queue.enqueue(func2) | |
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
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 |
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
./runtests.py --settings=test_sqlite get_earliest_or_latest |
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
curl -X POST -H "Content-Type: application/json" https://stamps.co.id/api/transactions/add -i -d '{ "token": "830a2413ccccd3f82ec39f10f8cf5852ea518815", "user_email": "kingman@softwarerestoran.com", "store": 104, "invoice_number": "2", "total_value": 50000 }' | |
# On Windows, double quotes need to be escaped: | |
curl -k -X POST -H "Content-Type: application/json" https://stamps.co.id/api/transactions/add -i -d "{ \"token\": \"6ef480e7ac6d374f5e29fdd9abff8cbfbbb9a7ea\", \"user_email\": \"customer@stamps.co.id\", \"store\": 11, \"invoice_number\": \"invoice_2\", \"total_value\": 50000}" | |
curl -k -X POST -H "Content-Type: application/json" https://stamps.co.id/api/transactions/add -i -d "{ \"token\": \"6ef480e7ac6d374f5e29fdd9abff8cbfbbb9a7ea\", \"user_email\": \"customer@stamps.co.id\", \"store\": 11, \"invoice_number\": \"invoice_3\", \"total_value\": 50000, \"items\": [{\"product_name\": \"Cappucino\", \"quantity\": 2, \"price\": 10000}, {\"product_name\": \"Iced Tea\", \"quantity\": 4, \"price\": 5000}]}" |
OlderNewer