aspe:martijnarts.com:XYN5VR5KPKSK7CXLPD4S5ITHLI
🏳️🌈
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 | |
LAST_WEEK_SEC="$(date -j -v-1w +'%s')" | |
psql -tc "SELECT json_build_object('date', (pg_stat_file('base/'||oid ||'/PG_VERSION')).modification AT TIME ZONE 'UTC', 'databaseName', datname) FROM pg_database" \ | |
| jq -r --arg LAST_WEEK_SEC "$LAST_WEEK_SEC" ' | |
[inputs] | |
| map( | |
select( | |
.databaseName |
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
interface Result< | |
// these types need to extend object, or they won't have props to access. | |
Ok extends object, | |
Err extends object | |
> { | |
map<NewOk extends object>(cb: (e: Ok) => NewOk): Result<NewOk, Err>; | |
mapErr<NewErr extends object>(cb: (e: Err) => NewErr): Result<Ok, NewErr>; | |
unwrapOk(): Ok | never; | |
unwrapErr(): Err | never; | |
[𐳱]: { |
⚠ These scripts perform DESCTRUCTIVE actions on your Github repositories. I strongly recommend against using this if you don't understand what the code does.
Will create a new branch on Github and change the default branch to it, and then delete the old one. You'll need JQ and the Github CLI for this.
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
history | awk '{ if ($2 == "git") print $3 }' | sort | uniq -c | sort -bgr |
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
### Keybase proof | |
I hereby claim: | |
* I am TotempaaltJ on github. | |
* I am totem (https://keybase.io/totem) on keybase. | |
* I have a public key whose fingerprint is EB52 570E 744B 6347 0B2D 6BD2 63D1 3203 8086 9004 | |
To claim this, I am signing this object: |
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 random | |
DICE = ( | |
('lightbulb', 'speech bubble', 'arrow', 'someone sleeping', 'house', | |
'clock'), | |
('lightning bolt', 'walking stick', 'mobile phone', 'alien', 'scales', | |
'pointer arrow'), | |
('turtle', 'dice', 'hand', 'scary shadow', 'dung beetle', | |
'magnifying glass'), | |
('bee', 'crescent moon', 'bridge', 'wand', 'book', 'abacus'), |
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
; Change {domain} to your domain name (or whatever you want to call the program) | |
; Change {modulename} to the Python module where you create your Flask app (for example, run if your file is called run.py) | |
; Change {website_root} to the directory wherever this module is located (/home/user/website/, for example) | |
[program:{domain}] | |
command=/usr/bin/uwsgi | |
--socket=/home/uwsgi/{domain}.sock | |
--pythonpath=/ | |
--touch-reload=/app.wsgi | |
--chmod-socket=664 | |
--uid=uwsgi |