Skip to content

Instantly share code, notes, and snippets.

View michaelwooley's full-sized avatar

Michael Wooley michaelwooley

View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@michaelwooley
michaelwooley / query.sql
Created January 26, 2023 01:03
Simple insert statement autogen for sqlalchemy
SELECT
m.name,
(
'INSERT INTO ' || m.name || '(' || GROUP_CONCAT (p.name, ', ') || ')VALUES(' || GROUP_CONCAT (
(
CASE
WHEN p.pk
AND m.sql LIKE "%AUTOINCREMENT%" THEN 'NULL'
ELSE ':' || p.name
END
@michaelwooley
michaelwooley / hooks.ts
Created May 11, 2022 23:15
Use custom headers when developing with SvelteKit
import type { Handle } from '@sveltejs/kit';
import config from '../svelte.config';
import { dev } from '$app/env';
/**
* Factory that generates a function to update response headers in dev mode in order to
* incorporate headers specified as part of vite config. If we don't do this, then fetching,
* e.g., html @ "/" in dev mode will not include our headers!
*
* In prod, need to use adapter-specific means to specify custom headers.
@michaelwooley
michaelwooley / emoji.txt
Last active April 26, 2022 03:21
Raw emoji in a single text file
©®😀😃😄😁😆😅🤣😂🙂🙃🫠😉😊😇🥰😍🤩😘😗☺😚😙🥲😋😛😜🤪😝🤑🤗🤭🫢🫣🤫🤔🫡🤐🤨😐😑😶🫥🌫😏😒🙄😬😮💨🤥😌😔😪🤤😴😷🤒🤕🤢🤮🤧🥵🥶🥴😵💫🤯🤠🥳🥸😎🤓🧐😕🫤😟🙁☹😯😲😳🥺🥹😦😧😨😰😥😢😭😱😖😣😞😓😩😫🥱😤😡😠🤬😈👿💀☠💩🤡👹👺👻👽👾🤖😺😸😹😻😼😽🙀😿😾🙈🙉🙊💋💌💘💝💖💗💓💞💕💟❣💔❤🔥🩹🧡💛💚💙💜🤎🖤🤍💯💢💥💦🕳💣💬👁🗨🗯💭💤👋👋🏻👋🏼👋🏽👋🏾👋🏿🤚🤚🏻🤚🏼🤚🏽🤚🏾🤚🏿🖐🖐🏻🖐🏼🖐🏽🖐🏾🖐🏿✋✋🏻✋🏼✋🏽✋🏾✋🏿🖖🖖🏻🖖🏼🖖🏽🖖🏾🖖🏿🫱🫱🏻🫱🏼🫱🏽🫱🏾🫱🏿🫲🫲🏻🫲🏼🫲🏽🫲🏾🫲🏿🫳🫳🏻🫳🏼🫳🏽🫳🏾🫳🏿🫴🫴🏻🫴🏼🫴🏽🫴🏾🫴🏿👌👌🏻👌🏼👌🏽👌🏾👌🏿🤌🤌🏻🤌🏼🤌🏽🤌🏾🤌🏿🤏🤏🏻🤏🏼🤏🏽🤏🏾🤏🏿✌✌🏻✌🏼✌🏽✌🏾✌🏿🤞🤞🏻🤞🏼🤞🏽🤞🏾🤞🏿🫰🫰🏻🫰🏼🫰🏽🫰🏾🫰🏿🤟🤟🏻🤟🏼🤟🏽🤟🏾🤟🏿🤘🤘🏻🤘🏼🤘🏽🤘🏾🤘🏿🤙🤙🏻🤙🏼🤙🏽🤙🏾🤙🏿👈👈🏻👈🏼👈🏽👈🏾👈🏿👉👉🏻👉🏼👉🏽👉🏾👉🏿👆👆🏻👆🏼👆🏽👆🏾👆🏿🖕🖕🏻🖕🏼🖕🏽🖕🏾🖕🏿👇👇🏻👇🏼👇🏽👇🏾👇🏿☝☝🏻☝🏼☝🏽☝🏾☝🏿🫵🫵🏻🫵🏼🫵🏽🫵🏾🫵🏿👍👍🏻👍🏼👍🏽👍🏾👍🏿👎👎🏻👎🏼👎🏽👎🏾👎🏿✊✊🏻✊🏼✊🏽✊🏾✊🏿👊👊🏻👊🏼👊🏽👊🏾👊🏿🤛🤛🏻🤛🏼🤛🏽🤛🏾🤛🏿🤜🤜🏻🤜🏼🤜🏽🤜🏾🤜🏿👏👏🏻👏🏼👏🏽👏🏾👏🏿🙌🙌🏻🙌🏼🙌🏽🙌🏾🙌🏿🫶🫶🏻🫶🏼🫶🏽🫶🏾🫶🏿👐👐🏻👐🏼👐🏽👐🏾👐🏿🤲🤲🏻🤲🏼🤲🏽🤲🏾🤲🏿🤝🤝🏻🤝🏼🤝🏽🤝🏾🤝🏿🙏🙏🏻🙏🏼🙏🏽🙏🏾🙏🏿✍✍🏻✍🏼✍🏽✍🏾✍🏿💅💅🏻💅🏼💅🏽💅🏾💅🏿🤳🤳🏻🤳🏼🤳🏽🤳🏾🤳🏿💪💪🏻💪🏼💪🏽💪🏾💪🏿🦾🦿🦵🦵🏻🦵🏼🦵🏽🦵🏾🦵🏿🦶🦶🏻🦶🏼🦶🏽🦶🏾🦶🏿👂👂🏻👂🏼👂🏽👂🏾👂🏿🦻🦻🏻🦻🏼🦻🏽🦻🏾🦻🏿👃👃🏻👃🏼👃🏽👃🏾👃🏿🧠🫀🫁🦷🦴👀👅👄🫦👶👶🏻👶🏼👶🏽👶🏾👶🏿🧒🧒🏻🧒🏼🧒🏽🧒🏾🧒🏿👦👦🏻👦🏼👦🏽👦🏾👦🏿👧👧🏻👧🏼👧🏽👧🏾👧🏿🧑🧑🏻🧑🏼🧑🏽🧑🏾🧑🏿👱👱🏻👱🏼👱🏽👱🏾👱🏿👨👨🏻👨🏼👨🏽👨🏾👨🏿🧔🧔🏻🧔🏼🧔🏽🧔🏾🧔🏿♂♀🦰🦱🦳🦲👩👩🏻👩🏼👩🏽👩🏾👩🏿🧓🧓🏻🧓🏼🧓🏽🧓🏾🧓🏿👴👴🏻👴🏼👴🏽👴🏾👴🏿👵👵🏻👵🏼👵🏽👵🏾👵🏿🙍🙍🏻🙍🏼🙍🏽🙍🏾🙍🏿🙎🙎🏻🙎🏼🙎🏽🙎🏾🙎🏿🙅🙅🏻🙅🏼🙅🏽🙅🏾🙅🏿🙆🙆🏻🙆🏼🙆🏽🙆🏾🙆🏿💁💁🏻💁🏼💁🏽💁🏾💁🏿🙋🙋🏻🙋🏼🙋🏽🙋🏾🙋🏿🧏🧏🏻🧏🏼🧏🏽🧏🏾🧏🏿🙇🙇🏻🙇🏼🙇🏽🙇🏾🙇🏿🤦🤦🏻🤦🏼🤦🏽🤦🏾🤦🏿🤷🤷🏻🤷🏼🤷🏽🤷🏾🤷🏿⚕🎓🏫⚖🌾🍳🔧🏭💼🔬💻🎤🎨✈🚀🚒👮👮🏻👮🏼👮🏽👮🏾👮🏿🕵🕵🏻🕵🏼🕵🏽🕵🏾🕵🏿💂💂🏻💂🏼💂🏽💂🏾💂🏿🥷🥷🏻🥷🏼🥷🏽🥷🏾🥷🏿👷👷🏻👷🏼👷🏽👷🏾👷🏿🫅🫅🏻🫅🏼🫅🏽🫅🏾🫅🏿🤴🤴🏻
@michaelwooley
michaelwooley / python_3_10_decorators.py
Created April 13, 2022 02:01
Experiment w/ decorators in python 3.10
import functools
from typing import Any, Callable, ParamSpec, Concatenate, TypeVar
import typing
P = ParamSpec("P") # Parameters remaining after decorator autofill
R = TypeVar("R") # Return type
def get_authenticated_user():
@michaelwooley
michaelwooley / global_vars_threading.py
Created March 27, 2021 01:32
Demos of how global variables play out when you're running python on multiple threads.
"""Demo behavior of global variables across threads.
"""
from threading import Thread
import time
shared_var = "outside" # global variable
def thread1(threadname: str) -> None:
global shared_var
@michaelwooley
michaelwooley / extensions.md
Last active August 26, 2020 21:25
prettier-plugin-svelte VS Code error
Extension Author (truncated) Version
vscode-sql-formatter adp 1.4.4
All-Autocomplete Ati 0.0.23
toml be5 0.5.1
vscode-tailwindcss bra 0.4.2
npm-intellisense chr 1.3.0
language-postcss cpy 1.1.0
vscode-eslint dba 2.1.8
githistory don 0.6.9
Terraform v0.12.29
Initializing plugins and modules...
2020/08/04 00:15:19 [DEBUG] Using modified User-Agent: Terraform/0.12.29 TFC/3ad8313ada
module.gitlab.gitlab_project_variable.crc-ci-node-example: Creating...
module.gitlab.gitlab_project_variable.crc-nest-simple: Creating...
module.kubernetes.kubernetes_namespace.app: Creating...
module.kubernetes.kubernetes_namespace.app: Creation complete after 1s [id=app]
module.kubernetes.kubernetes_secret.container-registry: Creating...
@michaelwooley
michaelwooley / index.html
Last active April 3, 2019 14:48
embeddable map example
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="manifest" href="site.webmanifest">
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.