namongk namongk

View thrifthelper.py
1 2 3 4 5 6 7 8 9 10
class ThriftConnection(object):
def __init__(self, service, host, port):
socket = TSocket.TSocket(host, port)
self.transport = TTransport.TFramedTransport(socket)
protocol = TBinaryProtocolAccelerated(self.transport)
self.client = service.Client(protocol)
self.transport.open()
self.open_time = time.time()
self.access_time = self.open_time
self.pid = os.getpid()
View .bowerrc
1 2 3 4
{
"directory": "src/_lib",
"json": "bower.json"
}
View fabric.py
1 2 3 4 5 6 7 8 9 10
"""
Distributor ID: Ubuntu
Description: Ubuntu 10.04 LTS
Release: 10.04
Codename: lucid
Author: Adelein Rodriguez, adeleinr@gmail.com
Note: This is an adaptation from a fabric script presented here:
http://morethanseven.net/2009/07/27/fabric-django-git-apache-mod_wsgi-virtualenv-and-p.html
 
Summary: This script:
View __init__.py
1 2 3 4 5 6 7 8 9
from fabric.api import env
 
env.use_ssh_config = True
env.forward_agent = True
 
env.roledefs = {
# key # hostname from config
'foo': ['foo.production'],
}
View korail.py
1 2 3 4 5 6 7 8 9 10
# -*- coding: utf-8 -*-
 
import requests
from bs4 import BeautifulSoup
from datetime import datetime
 
session = requests.session()
 
 
class Train(object):
View install.sh
1 2 3 4 5 6 7 8 9 10
#!/bin/sh
 
version="2.6.3"
priority="20603"
 
sudo mkdir -p /var/redis /var/log/redis
curl -sL http://redis.googlecode.com/files/redis-${version}.tar.gz | tar zx
cd redis-${version}/
make
sudo make PREFIX=/usr/local/redis/${version} install
View install-chef-os-x-mavericks.md

Chef install isn't optimized yet for OS X 10.9 but there's a hacky way to get it installed.

First, download the install file at https://www.opscode.com/chef/install.sh

Then, edit the install.sh file and change this part:

    "10.6") platform_version="10.6" ;;
    "10.7") platform_version="10.7" ;;
    "10.8") platform_version="10.7" ;;
View clear_johnny_cache.py
1 2 3 4 5 6 7 8 9 10
import sys
import logging
from optparse import make_option
 
from django.core.management.base import BaseCommand, CommandError
 
class Command(BaseCommand):
help = ("Invalidates portions of the queryset cache based on the app names"
" or models provided as arguments to the command. If no arguments "
"are provided, nothing is done. To clear the entire queryset "
View vignette.css
1 2 3 4 5 6 7 8 9 10
/* Border & Vignette Setup */
figure{
position: relative;
display: block;
line-height: 0;
width: 500px;
height: 333px;
margin-bottom: 2em;
border: 1em solid #fff;
View slugify.py
1 2 3 4 5 6 7 8
#-*-coding:utf-8-*-
import re
import unicodedata
 
from django.utils.encoding import smart_unicode
 
# Extra characters outside of alphanumerics that we'll allow.
SLUG_OK = '-_~'
Something went wrong with that request. Please try again.