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
--- | |
name: Update Python dependencies | |
on: | |
workflow_dispatch: {} | |
schedule: | |
# Run every Wednesday 6AM | |
- cron: "0 6 * * 3" | |
jobs: |
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/bash | |
if [ $# -lt 2 ]; then | |
echo "Usage: $0 <log_group_prefix> <log_stream_name>" | |
exit 1 | |
fi | |
LOG_GROUP_PREFIX=$1 | |
LOG_STREAM_NAME=$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
import json | |
import random | |
import http.client | |
# make call to cat facts API | |
# https://cat-fact.herokuapp.com/facts | |
conn = http.client.HTTPSConnection("cat-fact.herokuapp.com") | |
conn.request("GET", "/facts") | |
response = conn.getresponse() |
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
twitter.com##[aria-label$="Trending now" i] | |
twitter.com##article [aria-label^="Recommended Topic" i]:upward(article) |
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
(version 1) | |
(allow default) | |
(debug deny) | |
(define (home-subpath home-relative-subpath) | |
;; should be able to use something like (param "HOME_DIR") here, but it's not working for me | |
(subpath (string-append "/Users/pete" home-relative-subpath))) | |
;; can't write anywhere or read /Users by default | |
(deny file-write*) |
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 psycopg2 | |
NEW_USER = "fred" | |
types = {"c": "TABLE", "t": "TABLE", "r": "TABLE", "S": "SEQUENCE", "i": "INDEX", "v": "VIEW"} | |
with psycopg2.connect(**kwargs) as conn: | |
conn.autocommit = True | |
with conn.cursor() as curs: | |
for kind, name in types.items(): | |
curs.execute( |
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
pip install awscli # if you don't have it installed already | |
export AWS_ACCESS_KEY_ID=your-access-key # starts with AK | |
export AWS_SECRET_ACCESS_KEY=your-secret-key | |
echo "hello world" | aws s3 cp - s3://your-bucket-name/test.txt | |
aws s3 cp s3://your-bucket-name/test.txt - # this should output "hello world" |
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
{ | |
"Mappings": { | |
"LBAccountId": { | |
"af-south-1": { | |
"AccountId": "098369216593" | |
}, | |
"ap-east-1": { | |
"AccountId": "754344448648" | |
}, | |
"ap-northeast-1": { |
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
variable "TRANSFER_HOST_KEY" {} | |
locals { | |
transfer = { | |
az_count = 2 | |
} | |
} | |
resource "aws_eip" "transfer" { | |
count = local.transfer.az_count |
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
$ chmod +x install.sh | |
$ docker build -t pipenv . | |
$ docker create --name pipenv pipenv | |
$ docker cp pipenv:/pipenv . | |
$ diff pipenv/2018.11.14/Pipfile pipenv/2018.05.18/Pipfile && echo "no difference" | |
2d1 | |
< name = "pypi" | |
5,6c4 | |
< | |
< [dev-packages] |
NewerOlder