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 | |
# | |
# Script to check who of your Facebook friends were removed from FB or unfriend | |
# you. | |
# | |
# Requirements | |
# ============ | |
# | |
# * Linux / Mac OS X / other Unix | |
# * `Python <http://www.python.org/>`_ 2.6 or 2.7 |
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
>> ['00', '01', '02', '03', '04', '05', '06', '07', '08', '09'].map! {|x| Integer(x)} | |
ArgumentError: invalid value for Integer: "08" | |
from (irb):1:in `Integer' | |
from (irb):1 | |
from (irb):1:in `map!' | |
from (irb):1 | |
>> ['00', '01', '02', '03', '04', '05', '06', '07', '08', '09'].map! {|x| Integer(Float(x))} | |
=> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] |
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 datetime | |
from django.conf import settings | |
from django.contrib.auth import logout | |
from django.contrib.auth.models import User | |
from django.contrib.sessions.models import Session | |
from django.http import HttpRequest | |
from django.utils.importlib import import_module | |
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 logging | |
import os | |
DEBUG = False | |
TESTING = 'TESTING' in os.environ or 'nosetests' in os.environ.get('_', '') | |
try: | |
from settings_local import * |
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 | |
# | |
# Simple script to archive git repository. | |
# | |
branch=HEAD | |
dest=`echo ~/Projects` | |
format=zip | |
prefix=`basename $(pwd)` |
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
Checking env_base virtual environment... | |
ordereddict exists | |
minimock exists | |
0.9 | |
Checking env_child virtual environment... | |
ordereddict exists | |
minimock exists | |
0.8 |
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 | |
# | |
# Redirect outputs from pbs command result to file. | |
# | |
import os | |
import pbs | |
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 | |
# | |
# Run X processes in background and wait before each of this processes will | |
# end. | |
# | |
import sys | |
import time | |
from argparse import ArgumentParser |
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 flask import Flask | |
from flask.ext.sqlalchemy import SQLAlchemy | |
class App(Flask): | |
""" | |
Custom ``Flask`` class. | |
""" | |
def register_blueprint(self, mixed, **kwargs): | |
""" |
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
$ DRIVER=couchbase THREADS=10 make benchmark | |
env/bin/python ./benchmark.py | |
324 operations completed in 2.1607 s | |
2256 operations completed in 10.7558 s | |
1068 operations completed in 5.7570 s | |
2037 operations completed in 9.5393 s | |
2493 operations completed in 11.0871 s | |
2910 operations completed in 12.1000 s | |
2961 operations completed in 12.1318 s | |
2193 operations completed in 10.3703 s |