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 request_arg(arg_name, arg_type=str, arg_default=None): | |
""" | |
decorator to auto convert arg or form fields to | |
named method parameters with the correct type | |
conversion | |
@route('/something/<greeting>/') | |
@request_arg('repeat', int, 1) | |
def route_something(greeting='', repeat): |
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 bash | |
# install the latest version of Chrome and the Chrome Driver | |
apt-get update && apt-get install -y libnss3-dev | |
version=$(curl http://chromedriver.storage.googleapis.com/LATEST_RELEASE) | |
wget -N http://chromedriver.storage.googleapis.com/${version}/chromedriver_linux64.zip | |
unzip chromedriver_linux64.zip -d /usr/local/bin | |
chmod +x /usr/local/bin/chromedriver | |
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb | |
dpkg -i google-chrome-stable_current_amd64.deb; apt-get -fy install |
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
Define HOST example | |
Define HOST_URL www.${HOST}.com | |
Define DOCKER_PORT 8083 | |
<VirtualHost *:80> | |
ServerName ${HOST_URL} | |
ServerAlias ${HOST}.com | |
Redirect permanent / https://${HOST_URL}/ | |
</VirtualHost> |
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
# sorted list | |
class SortedList(list): | |
def __init__(self, initial_list_values): | |
super().__init__(sorted(initial_list_values)) | |
def append(self, new_value) -> None: | |
for pos, value in enumerate(self): | |
if new_value <= value: |
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 bash | |
DEPLOYMENT=$1 | |
for p in $(kubectl get pods | grep ^${DEPLOYMENT}- | cut -f 1 -d ' '); do | |
echo --------------------------- | |
echo $p | |
echo --------------------------- | |
kubectl logs $p | |
done |
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
/* | |
node js static web server with file change detection | |
based upon | |
https://gist.github.com/ryanflorence/701407 | |
by Andrew Rowe 2015. | |
requirements. | |
============= | |
npm install websocket | |