- Use six
- Use
six.u()
everywhere you expose a Unicode/String API (anything that is meant for Humans!) - Use
six.text_type()
in place ofunicode()
- Implement the following "Python special methods":
#!/bin/bash | |
function getpass() { | |
if [[ -f $HOME/.passwd.cpt ]]; then | |
password=$(ccrypt -c $HOME/.passwd.cpt | egrep $1 | cut -f 3 -d ":") | |
else | |
password=$(egrep $1 $HOME/.passwd | cut -f 3 -d ":") | |
fi | |
if [[ $password == "" ]]; then |
#!/bin/bash | |
# | |
# Copyright (c) 2008 by Jose V Beneyto, sepen at users dot sourceforge dot net | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: |
#!/bin/bash | |
PORT=$(dirname pwd) | |
cat - > Dockerfile <<EOF | |
FROM crux/base | |
VOLUME /usr/ports/contrib/test | |
RUN ports -u && prt-get cache |
#!/bin/bash | |
function getpass() { | |
if [[ -f $HOME/.passwd.cpt ]]; then | |
password=$(ccrypt -c $HOME/.passwd.cpt | egrep $1 | cut -f 3 -d ":") | |
else | |
password=$(egrep $1 $HOME/.passwd | cut -f 3 -d ":") | |
fi | |
if [[ $password == "" ]]; then |
#!/usr/bin/env python | |
import sys | |
from time import sleep | |
from functools import partial | |
import boto.ec2.autoscale |
#!/usr/bin/env python | |
from circuits.net.events import write | |
from circuits import handler, Component, Debugger | |
from circuits.net.sockets import TCPServer, UDPServer | |
class UDPTCPBroadcaster(Component): |
{ | |
"checks": { | |
"load_docker_metrics": { | |
"type": "metric", | |
"command": "load-docker-metrics.sh", | |
"subscribers": [ | |
"docker" | |
], | |
"interval": 10 | |
} |
autodock: | |
image: prologic/autodock | |
ports: | |
- "1338:1338/udp" | |
- "1338:1338/tcp" | |
volumes: | |
- /var/run/docker.sock:/var/run/docker.sock | |
restart: always | |
autodockhipache: |
six.u()
everywhere you expose a Unicode/String API (anything that is meant for Humans!)six.text_type()
in place of unicode()
from shapely.geometry import shape, Point, MultiPoint | |
import math | |
import json | |
def get_bounds(geometries): | |
"""Returns bounding box of geometries. Implementation creates a MultiPoint | |
from the boxes of all polygons in order to get the result""" | |
points = [] | |
for g in geometries: |