This file contains hidden or 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
| $ python -c "import math; [print(1/(math.sqrt(n))) for n in range(1, 1000)]" | uplot line -t "1/sqrt(n)" | |
| 1/sqrt(n) | |
| ┌────────────────────────────────────────┐ | |
| 1 │⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│ | |
| │⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│ | |
| │⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│ | |
| │⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│ | |
| │⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│ | |
| │⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│ | |
| │⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│ |
This file contains hidden or 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
| """ | |
| dagster dev -f dagster-example-map-reduce-graph-asset.py | |
| """ | |
| from itertools import chain | |
| from dagster import Definitions, DynamicOut, DynamicOutput, asset, graph_asset, op | |
| @asset |
This file contains hidden or 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 | |
| TARGET_MIDI_FILE="bk_cove.mid" | |
| STATIC_COVER_IMAGE="${HOME}/Downloads/bk_cover_image.jpg" | |
| # open midi file in Logic Pro | |
| open "$TARGET_MIDI_FILE" | |
| # use `osascript` to bounce the project, converting midi tracks to an audio file | |
| osascript \ |
This file contains hidden or 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
| USAGE | |
| $ dagster dev -f example-asset-check-iomanager.py | |
| """ | |
| from dagster import ( | |
| AssetCheckResult, | |
| Definitions, |
This file contains hidden or 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
| """Extracts git origin remote URLs for all git repositories in `TARGET_DIRECTORY`. | |
| This is useful if you would like to get a list of repositories from a project directory that you | |
| would like to clone elsewhere. | |
| """ | |
| import configparser | |
| import os |
This file contains hidden or 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
| """Renames epub files using title and author(s) present in metadata.""" | |
| import ebookmeta | |
| import os | |
| import shutil | |
| from glob import glob | |
| SOURCE_DIRECTORY = os.path.expanduser("~/Desktop/Books/") | |
| DESTINATION_DIRECTORY = os.path.expanduser("~/Desktop/Library/") |
This file contains hidden or 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 | |
| destination="/Users/colton/Desktop/Library" | |
| mkdir -p "$destination" | |
| cd /Users/colton/Library/Mobile Documents/iCloud~com~apple~iBooks/Documents | |
| for i in *.epub; do | |
| pushd "$i" | |
| zip --quiet -X0 "$destination/$i" mimetype |
This file contains hidden or 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
| """Leaflet map of all DMV Rapidpass locations. | |
| The rapidpassvirginia website provides invidiual links to latitude/longitude points on a Google map, | |
| making it very difficult to find the most ideal location for a rapid pass emmissions inspection. | |
| This script pulls the data from their website with `pd.read_html`, and plots it on a map using the | |
| `folium` library. | |
| PREREQUISITES | |
| pip install pandas folium |
This file contains hidden or 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 | |
| models=$(curl -s https://api.openai.com/v1/models -H "Authorization: Bearer $OPENAI_API_KEY") | |
| jq .data[].id <(echo "$models") | sort -u |
This file contains hidden or 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
| mkdir -p ~/.config/chatblade | |
| # create a custom prompt for programming | |
| echo "You are a helpful but succinct chatbot that assists an impatient \ | |
| programmer by directly answering questions. You understand that the \ | |
| programmer is advanced enough to understand succinct phrases and prefers \ | |
| direct answers with little boilerplate." >> ~/.config/chatblade/programmer | |
| # interactive use of custom prompt | |
| chatblade -i -p programmer |