Skip to content

Instantly share code, notes, and snippets.

import { eq } from "drizzle-orm";
import { type DrizzleD1Database } from "drizzle-orm/d1";
import { type GenericTable, project } from "./db/schema";
// This is what I'd like to use, which is defined with my schema.
// (See import above, though the rest of the file shouldn't be relevant.)
// type GenericTable = typeof <tableA> | typeof <tableB> | ...
// I also tried this, but it doesn't work either.
// const Tables = {
{"seo_category_infos":[["Beauty","beauty"],["Dance & Performance","dance_and_performance"],["Fitness","fitness"],["Food & Drink","food_and_drink"],["Home & Garden","home_and_garden"],["Music","music"],["Visual Arts","visual_arts"]],"logging_page_id":"profilePage_1964314453","show_suggested_profiles":false,"show_follow_dialog":false,"graphql":{"user":{"biography":"IU CS+Fin 2023\nPotato Enthusiast \ud83e\udd54","blocked_by_viewer":false,"restricted_by_viewer":false,"country_block":false,"external_url":"http://wadeflet.ch/","external_url_linkshimmed":"https://l.instagram.com/?u=http%3A%2F%2Fwadeflet.ch%2F&e=ATOgL2ae8YPuWEdiu5cfWlnbyo5Kze_WN7mjJk3B8XR8K4Y8BIM7Z1MSTNlrGoatEDraiP_eluOP8ZvGPpyugg&s=1","edge_followed_by":{"count":1345},"fbid":"17841401993595539","followed_by_viewer":false,"edge_follow":{"count":218},"follows_viewer":false,"full_name":"Wade Fletcher","has_ar_effects":false,"has_clips":false,"has_guides":false,"has_channel":false,"has_blocked_viewer":false,"highlight_reel_count":0,"has_requested_viewe
@wadefletch
wadefletch / SetUpANewMac.md
Last active August 28, 2020 18:35
How to Set Up a New Mac for Software Development

How to Set Up a New Mac for Software Development

Disable SIP

  1. Shutdown
  2. Boot to Recovery Mode (⌘+R).
  3. From Utilities in the Menubar, open Terminal.
  4. Run csrutil restart.
  5. Restart to Startup Disk

Homebrew

@wadefletch
wadefletch / tic-tac-toe.py
Last active April 22, 2020 07:17
tic-tac-toe.py
# TODO maybe reimplement with curses?
import random
import time
from typing import List, Union
class Board:
def __init__(self, size=3, player_char='\033[92mX\033[0m', computer_char='\033[91mO\033[0m'):
self.size = size

Keybase proof

I hereby claim:

  • I am wadefletch on github.
  • I am wadefletch (https://keybase.io/wadefletch) on keybase.
  • I have a public key whose fingerprint is B072 FC8B 8B54 DB2F 06BC 5B41 1830 A679 4030 F7A5

To claim this, I am signing this object:

{
"name": "Quantum#2582",
"channels": [{
"webhook": "[[WEBHOOK URL]]",
"shopify_urls": [
"https://kith.com",
"[[OTHER SHOPIFY URLS YOU WANT ON THIS WEBHOOK]]"
]
},
{
import tweepy
from datetime import datetime
import requests
import re
import os
CONSUMER_KEY = os.environ.get('TWITTER_CONSUMER_KEY')
CONSUMER_SECRET = os.environ.get('TWITTER_CONSUMER_SECRET')
ACCESS_TOKEN = os.environ.get('TWITTER_ACCESS_TOKEN')
ACCESS_SECRET = os.environ.get('TWITTER_ACCESS_SECRET')
import json
import click
from pathlib import Path
import os.path
import requests
from bs4 import BeautifulSoup
class Zacks(object):
def __init__(self, username, password):
self.username = username
import json
import requests
from bs4 import BeautifulSoup
class Zacks(object):
def __init__(self, username, password):
self.username = username
self.password = password
@wadefletch
wadefletch / todo.py
Last active April 10, 2024 14:57
Print from Todoist API to USB Thermal Printer
import todoist
from escpos import printer
therm = printer.Usb(0x0416, 0x5011) # connect to printer
api = todoist.TodoistAPI('79d4d663cc5011ab78cd7004e26a1a060572c823') # connect to todoist
api.sync() # get new data from todoist
therm.image('name.png') # print header image
therm.text('\n') # add a blank line