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/bash | |
/bin/chmod 0755 $0 | |
if [ ! -f "jinja_test.py" ]; then | |
cat <<EOF > jinja_test.py | |
import os | |
from flask import Flask, abort, render_template | |
from jinja2 import FileSystemLoader | |
app = Flask(__name__) | |
app.jinja_loader = FileSystemLoader( |
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 sys | |
import logging | |
# Do this in the top level of your module. | |
logging.root.setLevel(logging.DEBUG) # Or root logger level might override yours. | |
fmter = logging.Formatter("%(asctime)s %(levelname)s %(name)s(%(lineno)d): %(message)s") | |
# h = logging.FileHandler("logfile.log") | |
h = logging.StreamHandler(sys.stderr) | |
h.setFormatter(fmter) |
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
diff --git a/datamongo/dbobject.py b/datamongo/dbobject.py | |
index c824e47..2fe9e21 100644 | |
--- a/datamongo/dbobject.py | |
+++ b/datamongo/dbobject.py | |
@@ -146,13 +146,15 @@ class DBObject(DataObject, SchemaValidatorMixIn): | |
return None | |
@classmethod | |
- def find_all(cls, params=None, filter_data=None, limit=100): | |
- return list(cls.find_iter(params=params, filter_data=filter_data, limit=limit)) |
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
function restart_balancer() { | |
sh.stopBalancer(); | |
while (sh.isBalancerRunning()) { | |
sleep(1000); | |
} | |
sh.startBalancer(); | |
print("Balancer restarted at " + new ISODate() + "."); | |
} |
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
ERROR in api [/Users/dbr/socmongo/socmongo/views/api.py:140]: | |
comment/new.html: Invalid entry id: 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 |
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 magic | |
f = open("/Users/dbrandt/Desktop/Screen Shot 2014-05-26 at 17.44.34.png") | |
buf = f.read(32) | |
with magic.Magic() as m: | |
print m.id_buffer(buf) | |
"PNG image data, 1094 x 126, 8-bit/color RGB, non-interlaced" |
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 rabbitpy | |
def send(): | |
with rabbitpy.Connection() as conn: | |
with conn.channel() as chan: | |
ex = rabbitpy.DirectExchange(chan, "ping_ex") | |
ex.declare() | |
while True: | |
m = rabbitpy.Message(chan, "ping") | |
m.publish(ex, "ping_ex") |
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
[dbrandt@Daniels-MacBook-Pro|~] | |
% git clone https://github.com/loadimpact/loadimpact-cli.git | |
Cloning into 'loadimpact-cli'... | |
remote: Counting objects: 258, done. | |
remote: Total 258 (delta 0), reused 0 (delta 0), pack-reused 258 | |
Receiving objects: 100% (258/258), 43.08 KiB | 0 bytes/s, done. | |
Resolving deltas: 100% (161/161), done. | |
Checking connectivity... done. | |
[dbrandt@Daniels-MacBook-Pro|~] | |
% virtualenv licli |
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 | |
import sys | |
import pickle | |
from datetime import datetime, timedelta, tzinfo | |
import boto3 | |
import botocore | |
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
### Keybase proof | |
I hereby claim: | |
* I am dbrandt on github. | |
* I am dbrandt (https://keybase.io/dbrandt) on keybase. | |
* I have a public key ASCf44IqsQTGrasyo4xohTzlrOdsjQugB9u0G3e0MT0WhAo | |
To claim this, I am signing this object: |