Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View ryantuck's full-sized avatar
🤙
chillin'

Ryan Tuck ryantuck

🤙
chillin'
View GitHub Profile
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
@ryantuck
ryantuck / delete-local-merged-git-branches.sh
Created October 26, 2021 19:59
Delete local git branches that have been merged. I think assumes you're on master.
git branch --merged | grep -v master | xargs -I % git branch -D %
chrome://settings/searchEngines?search=search
Search engine: Jira
keyword: jira
URL: https://MYCORP.atlassian.net/secure/QuickSearch.jspa?searchString=%s
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):
{
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false
},
"profiles": [
{
"complex_modifications": {
"parameters": {
I would love to have the @tuck username and it looks very inactive!
{
"meta": {
"theme": "Class"
},
"basics": {
"name": "Ryan Tuck",
"email": "ryntck@gmail.com",
"phone": "609-315-1847",
"website": "http://ryantuck.io",
"summary": "I'm super cool.",

SQL Syntax Migration Guide - Postgres to BigQuery

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!

General

Casting

Postgres

@ryantuck
ryantuck / looker_content_validator.py
Last active October 31, 2019 18:56
Script to extract content from Looker Content Validator HMTL table
# 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.
dot -Kfdp -Nfontname=Courier -Nfontsize=10 -Efontname=Courier -Efontsize=10 -T{fmt} {dot_filepath} -o {output_filepath}