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
| """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
| 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
| #!/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
| """ | |
| 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
| $ 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
| -- Computes the NYC zones that have the most (relative) yellow cab disputes | |
| -- | |
| -- It is expected that the NYC yellow trip data set has been downloaded to `./data/nyc_yellow_tripdata` | |
| -- | |
| -- https://www.nyc.gov/site/tlc/about/tlc-trip-record-data.page | |
| -- | |
| -- USAGE | |
| -- $ du -sh data/nyc_yellow_tripdata/ | |
| -- 1.1G data/nyc_yellow_tripdata/ $ duckdb < nyc-yellow-taxi-duckdb.sql | |
| -- |
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
| install http_client from community; | |
| load http_client; | |
| with __input as ( | |
| select | |
| http_post( | |
| 'http://localhost:3000/graphql', | |
| headers => map { | |
| 'content-type': 'application/json', |
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
| if (!/.*\/profile\/.*\/followers/.test(document.URL)) { | |
| console.error( | |
| 'Make sure you are on your followers page!' | |
| ) | |
| } else { | |
| Array | |
| .from(document.getElementsByTagName('button')) | |
| .filter(el => el.innerText == 'Follow Back') | |
| .map(el => el.click()) | |
| } |
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
| Array | |
| .from(document.getElementsByTagName('button')) | |
| .filter(button => ! button.innerHTML.includes('Follows you')) | |
| .map(button => button.querySelector('button')) | |
| .filter(el => el !== null) | |
| .filter(el => el.innerText == 'Following') | |
| .map(button => button.click()); |