View sqlite-kv-restful.py
import os
import sqlite3
from hashlib import md5
from time import time
import simplejson as json
from flask import Flask
from flask.ext import restful
from flask import g
from flask import request
View options.py
from __future__ import unicode_literals
import re
import argparse
from functools import partial
class Options(argparse.ArgumentParser):
def __init__(self, **kwargs):
self._parsed = False
self._options = None
View github-repos-gists-backup.py
#!/usr/bin/python
import os
import json
import argparse
import time
import requests
from functools import partial
class GithubBackup(object):
def __init__(self, parameters):
View itertools.php
<?php
class Generator implements Iterator {
private $index = 0;
private $array = array();
private $keys = array();
private $filter = NULL;
private $mapper = NULL;
private $size = 0;
private $seek = 0;
private $last = NULL;
View extended-list.py
from collections import MutableSequence
import marshal
from operator import add, div, mul, neg, mod, sub
from operator import ge, gt, le, lt, eq
from itertools import imap
'''
Extended list class
- fast lookups by maintaining a dictionary with the values
- numeric operations between 2 instances are possible (like Octave matrices)
View python-c-module-example.c
/*
- setup.py
from distutils.core import setup, Extension
module = Extension('ht', sources = ['zmalloc.c', 'sds.c', 'dict.c', 'python-c-module-example.c'])
setup(name = 'Hash Table', version = '1.0', ext_modules = [module])
- install.sh
# Fetch dependencies from https://github.com/antirez/redis
wget https://raw.github.com/antirez/redis/2.6/src/fmacros.h
wget https://raw.github.com/antirez/redis/2.6/src/config.h
View cron-file-syntax-check.py
#!/usr/bin/python
import argparse
import os
import re
'''
**** Crontab file syntax checking ***
Useful for scripts stored under /etc/cron.d
and for automating crontab task distribution
'''
View cli.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import argparse
import readline
import rlcompleter
import shlex
import os
import re
try:
View python-mr.py
#!/usr/bin/env python
import os
import itertools
import multiprocessing as mp
from math import ceil
from types import GeneratorType as generator
from functools import partial
from time import time
View templater.php
<?php
class T {
protected $Context = array();
protected $Compiled = NULL;
public $Regex_Variable = '~\{\{\s+[a-z_0-9\|:\.]+\s+\}\}~imsu';
public $Separator_Filter = '|';
public $Separator_Directive = ':';
protected $HTML_Encoder = NULL;
protected $HTML_ENCODE = TRUE;
protected $VALUE_CACHE = array();