Skip to content

Instantly share code, notes, and snippets.

View baldwint's full-sized avatar

Tom Baldwin baldwint

View GitHub Profile
@jgdwyer
jgdwyer / dbt_demo.md
Created October 26, 2021 03:10
Set up instructions for dbt demo data in Snowflake data warehouse
  1. This will require a connection to a database. For this demo, I'll be using a Snowflake trial account. You can sign up for that here (no credit card required). You can also use a different database like postgresql. But configuration in later steps will be different.
  2. Create a new database and schema. For Snowflake you can run:
create database if not exists jaffle_shop;
create schema if not exists jaffle_shop.dbt_demo;
  1. Install dbt following the instructions here. I recommend installing dbt with pip into a Python virtual environment.
pip install dbt
@abstrctn
abstrctn / README.md
Last active October 5, 2021 17:49
Don't make assumptions about gender in your documentation

gender.vim

Don't make assumptions about gender in your documentation.

If you use VIM, you can use the following configuration to alert you to any gender-specific pronouns in your documentation, giving you the chance to de-gender them as necessary.

gender.vim extends the syntax highlighting of a filetype to highlight certain words.

You will need to load this after any default syntax highlighting gets applied to your filetype. The after directory in VIM gets loaded after other plugins or syntax files, making it the location where you should store extensions to existing behavior. If doesn't exist already, make a ~/.vim/after/syntaxdirectory, and placegender.vim` inside it.

@niallsmart
niallsmart / copy-checklist.js
Last active December 28, 2023 00:10
Copy Trello checklist to clipboard
copy($(".checklist-item:not(.checklist-item-checked)").map(function() {
var e = $(this),
item = e.find(".checklist-item-details-text").text()
if (e.hasClass("checklist-item-state-complete")) {
item = item + " (DONE)"
}
return item
}).get().join("\n"))
@seanh
seanh / formatFilename.py
Created April 11, 2009 18:30
Turn any string into a valid filename in Python.
def format_filename(s):
"""Take a string and return a valid filename constructed from the string.
Uses a whitelist approach: any characters not present in valid_chars are
removed. Also spaces are replaced with underscores.
Note: this method may produce invalid filenames such as ``, `.` or `..`
When I use this method I prepend a date string like '2009_01_15_19_46_32_'
and append a file extension like '.txt', so I avoid the potential of using
an invalid filename.