View gist:f14a1498f4b1280b8b6fba709a28e0aa
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
@router.get("/jwt/token") | |
async def generate_jwt() -> dict[str, bytes] | Literal[False]: | |
"""Returns JWT Token dev work. | |
Returns: | |
Token string or False. | |
""" | |
private_key = load_pem_private_key( |
View pre-commit
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 | |
# Generate example env file from current env file. | |
sed 's/=.*/=/' .env > .env.example | |
git add .env.example |
View .git-commit-template.txt
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
# <type>: (If applied, this commit will...) <subject> (Max 50 char) | |
# |<---- Using a Maximum Of 50 Characters ---->| | |
# Explain why this change is being made | |
# |<---- Try To Limit Each Line to a Maximum Of 72 Characters ---->| | |
# Provide links or keys to any relevant tickets, articles or other resources | |
# Example: Github issue #23 |
View form_state_update.py
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 python3 | |
import re | |
filename = 'fsp_competitive_cross_reference.cut_n_paste.inc' | |
# Read in the file | |
with open(filename, 'r') as file: | |
filedata = file.read() |
View nginx.conf
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
server { | |
server_name example.com; | |
root /var/www/drupal8; ## <-- Your only path reference. | |
location = /favicon.ico { | |
log_not_found off; | |
access_log off; | |
} | |
location = /robots.txt { |
View gist:6ca1eb643d3dd1ef29bafa97a102b164
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 | |
# If the file has already been modified don't try and modify it again | |
if grep -Fq "slack-night-mode" /Applications/Slack.app/Contents/Resources/app.asar.unpacked/src/static/ssb-interop.js; then | |
/usr/bin/osascript <<EOA | |
tell app "System Events" | |
display notification "Dark Mode enabled previously.\rYou have made your choice to forsake the Light Mode." with title "Slack Dark Mode" | |
end tell | |
EOA | |
exit 0; |
View gist:01660c990ee76be1c0a60ed615782932
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 -e | |
# Delete all stopped containers (including data-only containers). | |
docker ps -a -q --no-trunc --filter "status=exited" | xargs --no-run-if-empty docker rm -v | |
# Delete all tagged images more than a month old | |
# (will fail to remove images still used). | |
docker images --no-trunc --format '{{.ID}} {{.CreatedSince}}' | grep ' months' | awk '{ print $1 }' | xargs --no-run-if-empty docker rmi || true | |
# Delete all 'untagged/dangling' (<none>) images |
View bash.generate.random.alphanumeric.string.sh
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 | |
# bash generate random alphanumeric string | |
# | |
# bash generate random 32 character alphanumeric string (upper and lowercase) and | |
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) | |
# bash generate random 32 character alphanumeric string (lowercase only) | |
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1 |
View git template
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
# <type>(<scope>): <subject> | |
#|<---- Using a Maximum Of 50 Characters ---->| | |
# <body> | |
#|<---- Try To Limit Each Line to a Maximum Of 72 Characters ---->| | |
# <footer> | |
# Example: Closes #23 | |
# --- COMMIT END --- |
View Create Mysql User
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
mysql -u root | |
SELECT PASSWORD('MYFANCYPASSWORD') | |
copy the output hash * and all. | |
CREATE USER 'myfancyusername'@'%' IDENTIFIED BY PASSWORD '*HASH'; | |
GRANT ALL PRIVILEGES ON *.* TO 'myfancyusername'@'%' WITH GRANT OPTION; |
NewerOlder