Lightweight Python script to prepare Redis commands for mass insertion.
#!/usr/bin/env python
"""
redis-mass.py
if __name__ == "__main__": | |
f = open('input.txt', 'w') | |
for x in range(0,2000000): | |
s = "SADD set %s\n" % str(x) | |
f.write(s) |
import sys | |
if __name__ == "__main__": | |
f = None | |
try: | |
filename = sys.argv[1] | |
f = open(filename, 'r') | |
except IndexError: | |
f = sys.stdin.readlines() |
description "example hostname script" | |
author "Tim Simmons" | |
setuid bob | |
start on runlevel [2345] | |
stop on runlevel [!2345] | |
# retry if ended unexpectedly | |
respawn |
description "runs the celery worker" | |
author "Tim Simmons" | |
setuid celery | |
start on runlevel [2345] | |
stop on runlevel [!2345] | |
# retry if ended unexpectedly | |
respawn |
#![feature(core)] | |
fn print_type_of<T>(_: &T) -> () { | |
let type_name = | |
unsafe { | |
std::intrinsics::type_name::<T>() | |
}; | |
println!("{}", type_name); | |
} |
from ctypes import * | |
thelib = CDLL("liblib.dylib") | |
floatstruct = c_float * 3 | |
f = floatstruct(0.32, 0.44, 0.55) | |
thelib.arr.restype = c_float | |
p = pointer(f) |
from flask import Flask, jsonify | |
app = Flask(__name__) | |
@app.route('/') | |
def hello_world(): | |
return jsonify({'text': 'Hello World!', 'name': 'Tim'}) | |
if __name__ == '__main__': | |
app.run(debug=True) |
{ | |
"aliases": { | |
"create_zone": "v2:zones:create", | |
"create_domain": "v1:domains:create" | |
}, | |
"v2": { | |
"zones": { | |
"create": { | |
"body": { | |
"ttl": 300, |