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/sh | |
if [ "$1" = "config" ]; then | |
echo '{}' | |
fi | |
exit 0 |
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
git diff --name-status master..$(git symbolic-ref --short HEAD)|awk '{print $2}' |
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
var Node = function(vertices) { | |
var myVertices = vertices || []; | |
this.addVertex = function(vertex) { | |
myVertices.push(vertex); | |
}; | |
this.getVertices = function() { | |
return myVertices; | |
}; |
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/Dockerfile.j2 b/Dockerfile.j2 | |
index 09f09f9..7ebbaad 100644 | |
--- a/Dockerfile.j2 | |
+++ b/Dockerfile.j2 | |
@@ -9,4 +9,6 @@ COPY . /srv/helloworld/code | |
RUN echo "{{ BUILD_REVISION }}" > version-info.txt | |
RUN rm -rf env | |
RUN pip install -U . | |
-CMD bin/confd -confdir etc/confd/ -log-level info -backend etcd -node http://etcd-client:2379 | |
+ENV HELLOWORLD_DB_HOST localhost |
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
# standard wsgi middleware | |
def some_wsgi_middleware(app): | |
def middleware(environ, start_response) | |
def custom_start_response(status, headers, exc_info): | |
# they get overwritten here from func args | |
custom_start_response._status = status | |
custom_start_response._headers = headers | |
custom_start_response._status = custom_start_response._headers = None | |
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
# standard wsgi middleware | |
def some_wsgi_middleware(app): | |
def middleware(environ, start_response) | |
def custom_start_response(status, headers, exc_info): | |
# they get overwritten here from func args | |
custom_start_response._status = status | |
custom_start_response._headers = headers | |
response = app(environ, custom_start_response) |
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
board = { | |
'A': [' ', ' ', ' '], | |
'B': [' ', ' ', ' '], | |
'C': [' ', ' ', ' '], | |
} | |
def print_board(): | |
for i in "ABC": | |
print(" | {} | {} | {} |".format(*board[i])) |
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
# filter_plugins/zip.py | |
class FilterModule(object): | |
def filters(self): | |
return {'zip': zip} |
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 glob, sys, os, subprocess | |
path = os.path.abspath(os.path.dirname(__file__)) | |
files = glob.glob('*/*.mkv') | |
ffmpeg = '/home/wes/ffmpeg-dmo-2.1.1/ffmpeg' | |
for f in files: | |
f = os.path.join(path, f).replace(' ', '\\ ').replace('(', '\(').replace(')', '\)').replace('&', '\&').replace(';', '\;') |
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
def header(content, depth=1, underline=False): | |
if underline: | |
char = ('=', '-', '*')[(depth if depth < 4 else 3)] | |
return "{0}\n{1}".format(content, (char * len(content))) | |
return "{0} {1}".format(('#' * depth), content) | |
def quote(content, prefix='> '): | |
return "\n".join("> {0}".format(c) for c in content.split("\n")) |