I hereby claim:
- I am boris317 on github.
- I am shawnbytes (https://keybase.io/shawnbytes) on keybase.
- I have a public key whose fingerprint is 85AC 20B8 9C56 B0D5 F0F5 360B 0B04 9462 EDE5 D0C4
To claim this, I am signing this object:
def format_validation_error(error, parent=None, indent=""): | |
def recurse(e, parent): | |
return format_validation_error(e, parent=p(parent), | |
indent=indent + " ") | |
def p(child): | |
if parent is None: | |
return child |
import logging | |
from contextlib import contextmanager | |
from cStringIO import StringIO | |
@contextmanager | |
def log_context(logger_name, level=logging.DEBUG, formatter=None): | |
""" | |
:param logger_name: Name of your logger as passed to ``logging.getLogger``. | |
:param level: (optional) logging level to capture. |
# kodi-upstart | |
env DISPLAY=:0.0 | |
description "Kodi upstart script" | |
author "Shawn Adams" | |
start on (filesystem and stopped udevtrigger) | |
stop on runlevel [016] | |
# tell upstart to respawn the process if abnormal exit |
[Unit] | |
Description=CouchPotato application instance | |
[Service] | |
ExecStart=/media/nzb_apps/CouchPotatoServer/CouchPotato.py --daemon --data_dir=/media/nzb_apps/.couchpotato | |
GuessMainPID=no | |
Type=forking | |
User=root | |
Group=root |
# in for loop of method 'build_inventory' | |
if "-" in droplet['name']: | |
# Create new groups for names like prod-appname-whatever | |
# Given the above name, 2 new groups would be created "prod" | |
# and "prod-appname" | |
parts = droplet['name'].split("-") | |
if len(parts) > 1: | |
self.push(self.inventory, "-".join(parts[0:2]), dest) | |
self.push(self.inventory, parts[0], dest) |
I hereby claim:
To claim this, I am signing this object:
# p4 diff by changelist | |
function p4d { | |
if [ "$1" == "" ] | |
then | |
echo "usage: p4d CL"; | |
return 1; | |
fi | |
p4 opened -c $1 | sed -e 's/#.*//' | p4 -x - diff -du | less | |
} |
#!/bin/bash | |
# Usage: $ ./install-packer.sh | |
brew install golang | |
# Create go workspace dir | |
mkdir ~/golang | |
cat << EOF > ~/.bashrc | |
# Golang | |
export GOPATH=$HOME/golang |
""" | |
For reference wtforms.core.FloatField | |
------------------------------------- | |
class FloatField(Field): | |
widget = widgets.TextInput() | |
def __init__(self, label=None, validators=None, **kwargs): | |
super(FloatField, self).__init__(label, validators, **kwargs) |
existing_hash = {:foo=>"bar"} | |
other_hash.each_pair do |key, value| | |
if some_condition | |
existing_hash[key] = value | |
end | |
end |