This file contains hidden or 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
| /** | |
| * SEMANTIC COLUMN TOOLKIT v1.0 | |
| * * Provides a set of custom Google Sheets functions to reference data by column name | |
| * rather than static column letters. Designed to survive column reordering, row | |
| * insertions/deletions, and to handle date-formatted headers (e.g., "Jan"). | |
| * * Functions included: | |
| * - NAMED_COLUMN_CELL: Fetches a single cell value from a column by name, not letter. | |
| * - NAMED_COLUMN_RANGE: Fetches an entire vertical array (useful for SUM/AVERAGE) by column name, not letter. | |
| * - COLUMN_NAMED: Returns the current column letter of a named header. | |
| * - DEREF: Helper to resolve a cell value from a column letter and row number. |
This file contains hidden or 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
| #!/usr/bin/env bash | |
| # | |
| # Docker Engine Installation Script for Debian, Ubuntu, and Linux Mint | |
| # Run with: sudo ./install-docker-engine.sh [username...] | |
| # | |
| # Supports: | |
| # - Debian (stable releases) | |
| # - Ubuntu (and derivatives like Kubuntu, Lubuntu, Xubuntu) | |
| # - Linux Mint (Ubuntu-based editions) | |
| # - LMDE (Linux Mint Debian Edition) |
This file contains hidden or 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
| #!/usr/bin/env tsx | |
| // Usage: $0 your-sql-statement | |
| // Prerequisites: npx, npm package `pg`, SUPABASE_DB_URL env var | |
| import { Client } from 'pg' | |
| const SUPABASE_DB_URL: string = process.env.SUPABASE_DB_URL || '' |
This file contains hidden or 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
| # Creates a brand new supabase project and updates the .env to point to it. | |
| # | |
| # Prerequisites: | |
| # | |
| # * Required: npx | |
| # | |
| # * Required: A .env.min file with the following content: | |
| # SUPABASE_ORG_ID=yourorgid | |
| # SUPABASE_REGION=us-east-1 # or whatever | |
| # SUPABASE_DB_PASSWORD=thenewdbpassword |
This file contains hidden or 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
| CREATE OR REPLACE FUNCTION reset_supabase_project() | |
| RETURNS void | |
| LANGUAGE plpgsql | |
| AS ' | |
| DECLARE | |
| r RECORD; | |
| BEGIN | |
| -- Drop all user-created tables in public schema | |
| FOR r IN ( | |
| SELECT tablename FROM pg_tables |
This file contains hidden or 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
| #!/bin/bash | |
| # GitHub subdirectory recursive fetcher | |
| # Usage: ./fetch_github_subdir.sh <owner> <repo> <subdirectory> [branch] | |
| set -e | |
| if [ $# -lt 3 ]; then | |
| echo "Usage: $0 <owner> <repo> <subdirectory> [branch]" | |
| echo "Example: $0 facebook react packages/react main" |
This file contains hidden or 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
| # Sample namecheap /etc/ddclient.conf | |
| # These are defaults applicable to the remainder of the file | |
| daemon=300 | |
| ssl=yes | |
| use=web | |
| web=dynamicdns.park-your-domain.com/getip | |
| protocol=namecheap | |
| server=dynamicdns.park-your-domain.com | |
| login=your-root-domain.com # NOT your namecheap.com account name! |
This file contains hidden or 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
| // NOTE: inspired by https://www.innoq.com/en/blog/structured-logging/#structuredarguments | |
| import net.logstash.logback.argument.StructuredArguments.kv | |
| import org.slf4j.Logger | |
| const val DEFAULT_KEY = "ctx" | |
| internal fun o(ctx: Any? = null) = kv( | |
| DEFAULT_KEY, | |
| object { |
This file contains hidden or 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
| #!/usr/bin/env bash | |
| usage() { | |
| cat <<EOF | |
| usage: | |
| $0 -p productId remappings | |
| options: | |
| -p,--product-id: productId The keyboard product id (from Menu Bar\\⌥\SystemInformation...\Hardware) |
This file contains hidden or 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
| // stolen from https://gist.github.com/mikeal/1840641#gistcomment-3126524 | |
| import { createServer } from 'net' | |
| export default function getPort (port = 80, maxPort = 65535) { | |
| if ((maxPort = parseInt(maxPort)) < (port = parseInt(port)) || isNaN(port) || isNaN(maxPort) || port < 0 || port > 65535 || maxPort < 0 || maxPort > 65535) { | |
| return Promise.reject((() => { | |
| const e = new Error('EPORTSPEC') | |
| e.code = e.message | |
| return e |
NewerOlder