I'm in the process of migrating a lot of SQL (in LookML) from PostgreSQL to BigQuery (Standard SQL). Documenting the quirks I find along the way here!
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
from pydantic import BaseModel | |
from typing import List | |
class InputItem(BaseModel): | |
song_id: str | |
audio_filename: str | |
class OutputItem(BaseModel): | |
song_id: str | |
audio_filenames: list # of strs |
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
git branch --merged | grep -v master | xargs -I % git branch -D % |
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
chrome://settings/searchEngines?search=search | |
Search engine: Jira | |
keyword: jira | |
URL: https://MYCORP.atlassian.net/secure/QuickSearch.jspa?searchString=%s |
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
class RecursiveNamespace(SimpleNamespace): | |
""" | |
Recursive instantiation of SimpleNamespace for supporting nested dicts. | |
Literally copied from the internet: https://dev.to/taqkarim/extending-simplenamespace-for-nested-dictionaries-58e8 | |
""" | |
@staticmethod | |
def map_entry(entry): | |
if isinstance(entry, dict): |
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
{ | |
"global": { | |
"check_for_updates_on_startup": true, | |
"show_in_menu_bar": true, | |
"show_profile_name_in_menu_bar": false | |
}, | |
"profiles": [ | |
{ | |
"complex_modifications": { | |
"parameters": { |
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
I would love to have the @tuck username and it looks very inactive! |
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
{ | |
"meta": { | |
"theme": "Class" | |
}, | |
"basics": { | |
"name": "Ryan Tuck", | |
"email": "[email protected]", | |
"phone": "609-315-1847", | |
"website": "http://ryantuck.io", | |
"summary": "I'm super cool.", |
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
# this is probably less elegant than just using the API to do this | |
# https://docs.looker.com/reference/api-and-integration/api-reference/v3.1/content#validate_content | |
# largely copied from https://stackoverflow.com/a/44275458 | |
import csv | |
from bs4 import BeautifulSoup | |
# find the table where all the data lives via 'inspect element' or whatever | |
# and save it into a file that we read here. |
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
dot -Kfdp -Nfontname=Courier -Nfontsize=10 -Efontname=Courier -Efontsize=10 -T{fmt} {dot_filepath} -o {output_filepath} |
NewerOlder