Skip to content

Instantly share code, notes, and snippets.

View darksinge's full-sized avatar

Craig Blackburn darksinge

View GitHub Profile
@S1M0N38
S1M0N38 / install-lua-luarocks-on-macos.sh
Last active June 26, 2025 16:17 — forked from zirkuswurstikus/lua_build_macos.sh
A simple script to install Lua and Luarocks from source in a custom dir
#!/bin/bash
# This scripts installs Lua, LuaRocks, and some Lua libraries on macOS.
# The main purpose is to install Busted for testing Neovim plugins.
# After the installation, you will be able to run test using busted:
# busted --lua nlua spec/mytest_spec.lua
################################################################################
# Dependencies
################################################################################
@darksinge
darksinge / Custom SST Auth Adapter.md
Last active July 17, 2024 05:03
Custom SST Auth Adapter

First, the Auth construct adds an /auth route to the API.

const auth = new Auth(stack, 'auth', {
  authenticator: {
    handler: 'auth.handler',
  },
});

const api = new Api(stack, 'api', {
@ciiqr
ciiqr / zod-optional-null.ts
Last active June 24, 2025 05:51
zod optional/nullable/nullish differences
// zod schema
z.object({
// valid if string or:
optional: z.string().optional(), // field not provided, or explicitly `undefined`
nullable: z.string().nullable(), // field explicitly `null`
nullish: z.string().nullish(), // field not provided, explicitly `null`, or explicitly `undefined`
});
// type
{
@darksinge
darksinge / eslint-and-prettier-setup.md
Last active October 5, 2022 16:10
Eslint+prettier setup

Typescript Setup (npm)

Install dependencies

$ npm i --save-dev eslint @typescript-eslint/parser @typescript-eslint/eslint-plugin prettier eslint-config-prettier eslint-plugin-prettier

.eslintrc.js

module.exports = {
@sts10
sts10 / rust-command-line-utilities.markdown
Last active July 7, 2025 16:53
A curated list of command-line utilities written in Rust

A curated list of command-line utilities written in Rust

Note: I have moved this list to a proper repository. I'll leave this gist up, but it won't be updated. To submit an idea, open a PR on the repo.

Note that I have not tried all of these personally, and cannot and do not vouch for all of the tools listed here. In most cases, the descriptions here are copied directly from their code repos. Some may have been abandoned. Investigate before installing/using.

The ones I use regularly include: bat, dust, fd, fend, hyperfine, miniserve, ripgrep, just, cargo-audit and cargo-wipe.

  • atuin: "Magical shell history"
  • bandwhich: Terminal bandwidth utilization tool
# Reconstructed via infocmp from file: /usr/share/terminfo/t/tmux-256color
tmux-256color|tmux with 256 colors,
OTbs, OTpt, am, hs, km, mir, msgr, xenl, AX, G0,
colors#256, cols#80, it#8, lines#24, pairs#32767, U8#1,
acsc=++\,\,--..00``aaffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, civis=\E[?25l,
clear=\E[H\E[J, cnorm=\E[34h\E[?25h, cr=^M,
csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H,
cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C,
cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\EM,
@qoomon
qoomon / conventional-commits-cheatsheet.md
Last active July 9, 2025 19:53
Conventional Commits Cheatsheet
@cablespaghetti
cablespaghetti / ecr-cred-updater.sh
Last active May 24, 2024 06:14
Automatic Updating Amazon ECR Credentials in Kubernetes
#!/bin/bash
# Get directory of script
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
if [[ $# -ne 1 ]]
then
echo "ERROR: This script expects the namespace name to be given as an argument"
echo "e.g. ./ecr-cred-updater.sh my-namespace"
exit 1
@shortjared
shortjared / list.txt
Last active June 26, 2025 12:00
List of AWS Service Principals
a4b.amazonaws.com
access-analyzer.amazonaws.com
account.amazonaws.com
acm-pca.amazonaws.com
acm.amazonaws.com
airflow-env.amazonaws.com
airflow.amazonaws.com
alexa-appkit.amazon.com
alexa-connectedhome.amazon.com
amazonmq.amazonaws.com
@javisperez
javisperez / interceptors.js
Last active December 4, 2022 16:47
Axios interceptor for cache with js-cache
// Usually I use this in my app's config file, in case I need to disable all cache from the app
// Cache is from `js-cache`, something like `import Cache from 'js-cache';`
const cacheable = true,
cache = new Cache();
// On request, return the cached version, if any
axios.interceptors.request.use(request => {
// Only cache GET requests
if (request.method === 'get' && cacheable) {