- let's try outlines
- here's something that i'd love to ensure gets wrapped oh wow, v cool
- how about this?
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
| dot -Kfdp -Nfontname=Courier -Nfontsize=10 -Efontname=Courier -Efontsize=10 -T{fmt} {dot_filepath} -o {output_filepath} |
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
| from: | |
| base: orders | |
| joins: | |
| - name: items | |
| type: inner | |
| on: items.order_id = orders.id | |
| - name: products | |
| type: inner | |
| on: products.id = items.product_id | |
| - name: shipments |
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
| """ | |
| TruffleHog Results Parsing | |
| Designed to operate on the output of trufflehog's json output: | |
| $ trufflehog --json <my_repo> > my_output.json | |
| Expects a `trufflehog_output.json` file, and a `trufflehog_whitelist.yml` file. | |
| Whitelist config file should look like: |
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
| import random | |
| import time | |
| import multiprocessing as mp | |
| def sleep_random(n): | |
| sleep_seconds = random.randint(0, 3) | |
| print(f'sleeping for {sleep_seconds} seconds') | |
| # randomly fail | |
| x = 5 / sleep_seconds |
How to squash commits, for when you forget:
• ~/src $$$ mkdir git-stuff
• ~/src $$$ cd git-stuff/
• ~/src/git-stuff $$$ git init
Initialized empty Git repository in /Users/ryan.tuck/src/git-stuff/.git/
• ~/src/git-stuff $$$ git status
On branch master
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
| import json | |
| import random | |
| def _gen_ids(b,e): | |
| return f'generate_series({b}, {e})::bigint' | |
| def _gen_float(): | |
| return 'random()' |
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
| import csv | |
| import os | |
| source_filename = 'all.csv' | |
| records_per_file = 1000 | |
| target_file_prefix = 'target/split' | |
| with open(source_filename, 'r') as source: | |
| reader = csv.reader(source) |
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
| id | edge_top | edge_right | edge_bottom | edge_left | orientation | row | col | |
|---|---|---|---|---|---|---|---|---|
| 2917 | tab-7750469 | tab-17732443 | tab-4722623 | tab-8858929 | ||||
| 5881 | tab-38067713 | blank-29069783 | blank-37044419 | tab-16331537 | ||||
| 6199 | tab-36443921 | tab-30988801 | tab-21950659 | tab-37745711 | ||||
| 4217 | tab-11213003 | tab-1463299 | blank-8505689 | tab-27330377 | ||||
| 1019 | blank-4370491 | tab-7873813 | tab-3761129 | blank-8069461 | ||||
| 6337 | tab-46570613 | tab-34099397 | blank-37077787 | blank-3035423 | ||||
| 3517 | blank-8901527 | blank-7867529 | tab-23279023 | tab-18671753 | ||||
| 7069 | tab-34433099 | blank-39027949 | tab-43976249 | blank-6029857 | ||||
| 7691 | blank-26664697 | tab-51675829 | tab-60966557 | tab-2407283 |