Skip to content

Instantly share code, notes, and snippets.

View Martlark's full-sized avatar

Andrew Rowe Martlark

View GitHub Profile
Martlark /
Last active March 8, 2021 00:09
Flask Decorator to auto convert request arg to a method parameter
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
@request_arg('repeat', int, 1)
def route_something(greeting='', repeat):
Martlark /
Created April 3, 2020 22:17
Install Google Chrome and Chrome driver to Linux 18.04
#!/usr/bin/env bash
# install the latest version of Chrome and the Chrome Driver
apt-get update && apt-get install -y libnss3-dev
wget -N${version}/
unzip -d /usr/local/bin
chmod +x /usr/local/bin/chromedriver
dpkg -i google-chrome-stable_current_amd64.deb; apt-get -fy install
Martlark / example.conf
Last active January 27, 2020 02:48
Reverse proxy conf for a Docker application using an Apache proxy with letsencrypt
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}/
Martlark /
Created July 7, 2019 01:14
Python SortedList class derived from List
# sorted list
class SortedList(list):
def __init__(self, initial_list_values):
def append(self, new_value) -> None:
for pos, value in enumerate(self):
if new_value <= value:
Martlark /
Last active October 29, 2023 14:54
Simple script to get logs from the pods of a deployment
#!/usr/bin/env bash
for p in $(kubectl get pods | grep ^${DEPLOYMENT}- | cut -f 1 -d ' '); do
echo ---------------------------
echo $p
echo ---------------------------
kubectl logs $p
Martlark / static_server.js
Last active September 3, 2015 02:55 — forked from ryanflorence/static_server.js
Node.JS static file web server. Put it in your path to fire up servers in any directory, takes an optional port argument. With file change detection. Requirements: npm install websocket. To use. place in head of your html files <meta detection-change="true"> so that it will auto refresh if any served files change.
node js static web server with file change detection
based upon
by Andrew Rowe 2015.
npm install websocket