Skip to content

Instantly share code, notes, and snippets.

Avatar

Kelvin Koh stupoid

View GitHub Profile
@stupoid
stupoid / lambda_canary.py
Last active Feb 23, 2021
Modified version of lambda-canary blueprint to monitor multiple sites and log via telegram_bot
View lambda_canary.py
import os
from urllib.parse import urlencode
from urllib.request import Request, urlopen
def getenvbool(key: str, default: bool) -> bool:
envvar = os.getenv(key, "").lower()
if envvar in {"true", "1"}:
return True
elif envvar in {"false", "0"}:
@stupoid
stupoid / scripts.sh
Created Dec 23, 2020
General shell scripts for python dev
View scripts.sh
#!/bin/sh
lint() {
TARGET_FOLDERS=$@
if [ -z "$TARGET_FOLDERS" ]; then
TARGET_FOLDERS="app tests"
fi
echo "linting folders $TARGET_FOLDERS..."
echo "running autoflake"
@stupoid
stupoid / .eslintrc.json
Created Jun 1, 2017
react eslint config
View .eslintrc.json
{
"extends": "airbnb",
"plugins": [
"react",
"jsx-a11y",
"import"
],
"env": {
"browser": true,
"node": true
@stupoid
stupoid / profile_examples.json
Created Oct 2, 2015
Example profile questions
View profile_examples.json
{
"title": "name",
"type": "text"
}
{
"title": "How do you feel about tbe current state of politics",
"type": "textarea"
}