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
{"data":{"stations":[{"is_renting":1,"num_bikes_disabled":1,"is_installed":1,"num_bikes_available":10,"legacy_id":"72","is_returning":1,"eightd_has_available_keys":false,"num_ebikes_available":2,"station_id":"72","last_reported":1604455485,"num_docks_disabled":0,"num_docks_available":44,"station_status":"active"},{"is_renting":1,"num_bikes_disabled":2,"is_installed":1,"num_bikes_available":25,"legacy_id":"79","is_returning":1,"eightd_has_available_keys":false,"num_ebikes_available":0,"station_id":"79","last_reported":1604455168,"num_docks_disabled":0,"num_docks_available":6,"station_status":"active"},{"is_renting":1,"num_bikes_disabled":1,"is_installed":1,"num_bikes_available":17,"legacy_id":"82","is_returning":1,"eightd_has_available_keys":false,"num_ebikes_available":0,"station_id":"82","last_reported":1604456065,"num_docks_disabled":0,"num_docks_available":9,"station_status":"active"},{"is_renting":1,"num_bikes_disabled":0,"is_installed":1,"num_bikes_available":43,"legacy_id":"83","is_returning":1,"eightd_ |
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 os | |
from typing import List | |
import sys | |
from ansible.plugins.callback import CallbackBase | |
# this file goes in a "callback_plugins" folder next to your playbook file | |
class CallbackModule(CallbackBase): | |
CALLBACK_VERSION = 2.0 | |
CALLBACK_TYPE = 'aggregate' # no idea what this var does, can't find documentation :( |
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 | |
GLOBIGNORE="*" # to prevent schedule from becoming wacky | |
if [ "$1" = "-h" ]; then | |
echo "Usage: $(basename "$0") check_name \"schedule\" \"command\" alert_channel1,alert_channel2 \"tag1 tag2\" \"description\" grace" | |
echo "Everything after \"command\" is optional. Grace is a number, if specified" | |
echo "Example: $(basename "$0") influxdb_is_running \"* * * * *\" \"influx -execute 'SHOW DATABASES'\" VictorOps \"devops\"" | |
echo "Please make sure VPC_NAME and HEALTHCHECKS_API_KEY are set before running the script" | |
exit 0 | |
fi |
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
#$end # for arepl | |
# Rough Draft | |
import json | |
from typing import List | |
import requests | |
API_URL_BASE = "https://healthchecks.io/api/v1/" | |
API_READONLY_key = "stop looking at my naughty bits" |
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 re | |
# run ./git-most.sh > most.txt before this script | |
# adjust whitelist var if you only want to see changes to a certain filetype/file/path | |
most_changed_paths = {} | |
whitelist = '' # '.yml' | |
with open('most.txt') as f: | |
for line in f.readlines(): |
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
export MB_DB_TYPE=postgres | |
export MB_DB_PORT=5432 | |
export MB_DB_USER=postgres | |
export MB_DB_PASS= | |
export MB_DB_HOST=db.metabase.staging | |
sudo docker cp metabase:/app/metabase.jar . | |
sudo docker stop metabase | |
java -jar metabase.jar load-from-h2 /home/metabase/metabase-data/metabase.db/metabase.db |
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 django | |
import doesNotExist | |
import math | |
import inspect | |
from typing import List | |
class foo: | |
def constructor(self, x): | |
self.x = x |
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
// simple types: see https://learnxinyminutes.com/docs/typescript/ | |
///////////////////////////////////////////////////////////////////////////// | |
// generic function | |
// old: | |
const foo: a => a; | |
// new: | |
const foo: <T extends any>(a: T) => a; | |
///////////////////////////////////////////////////////////////////////////// |