Skip to content

Instantly share code, notes, and snippets.

View justsml's full-sized avatar
🔥
Stealing fire

Dan Levy justsml

🔥
Stealing fire
View GitHub Profile
@boxabirds
boxabirds / .cursorrules
Last active June 6, 2025 06:01
Rock solid: turn Cursor into a rock-solid software engineering companion
# Project Policy
This policy provides a single, authoritative, and machine-readable source of truth for AI coding agents and humans, ensuring that all work is governed by clear, unambiguous rules and workflows. It aims to eliminate ambiguity, reduce supervision needs, and facilitate automation while maintaining accountability and compliance with best practices.
# 1. Introduction
> Rationale: Sets the context, actors, and compliance requirements for the policy, ensuring all participants understand their roles and responsibilities.
## 1.1 Actors
@justsml
justsml / .env.load.sh
Created May 7, 2025 23:43
✨ 1Password secret loader script
#!/bin/bash
set -eo pipefail
# check for `op`
if ! command -v op &> /dev/null; then
printf "\nError: op could not be found\n\n" >&2
printf "Please install 1Password CLI: https://developer.1password.com/docs/cli/get-started\n\n" >&2
printf "MacOS+brew: brew install 1password-cli\n\n" >&2
exit 1
fi
@jonstuebe
jonstuebe / ReSocket.ts
Created December 22, 2023 15:33
A WebSocket class with reconnection support
class ReSocket {
private token: string | undefined;
private socket: WebSocket | undefined;
private listeners: boolean = false;
private currentAttempt: number = 0;
private backoffTime: number = 1000;
private maxAttempts: number = 30;
private timer: NodeJS.Timeout | undefined;
private messageFn: (data: any) => void = (data) => {
//
@lawrencegripper
lawrencegripper / blockkit.schema.json
Created October 10, 2023 20:39
Slack Blockkit json schema
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"enum": [
"image",
"context",
@fraune
fraune / touch_id_sudo.sh
Last active December 13, 2024 02:19
Let Touch ID authorize the `sudo` terminal command in macOS 14+
sudo sh -c 'echo "auth sufficient pam_tid.so" > /etc/pam.d/sudo_local'
/**
* `filteredFlagFactory` supports 3 states of a feature flag:
* - True,
* - False,
* - and restricted by ID(s).
*
*/
export function filteredFlagFactory(
flagValue: string,
defaultIdField = 'userId'
@justsml
justsml / RectangleConfig.json
Last active May 19, 2022 21:05
Rectangle: customized config for ⭐️ Mac window layout utility.
{
"bundleId" : "com.knollsoft.Rectangle",
"defaults" : {
"allowAnyShortcut" : {
"bool" : false
},
"almostMaximizeHeight" : {
"float" : 0
},
"almostMaximizeWidth" : {
@shqld
shqld / cargo_x86_64-unknown-linux-gnu-on-m1-mac.sh
Created March 15, 2022 14:19
cargo build for the target x86_64-unknown-linux-gnu on M1 Mac
# https://github.com/messense/homebrew-macos-cross-toolchains
brew tap messense/macos-cross-toolchains
brew install x86_64-unknown-linux-gnu
export CC_X86_64_UNKNOWN_LINUX_GNU=x86_64-unknown-linux-gnu-gcc
export CXX_X86_64_UNKNOWN_LINUX_GNU=x86_64-unknown-linux-gnu-g++
export AR_X86_64_UNKNOWN_LINUX_GNU=x86_64-unknown-linux-gnu-ar
export CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=x86_64-unknown-linux-gnu-gcc
@justsml
justsml / macos-setup.md
Last active January 7, 2024 14:06
MacOS setup

MacOS - Software Developer Environment Setup

Dan's collection of MacOS setup and configuration scripts, updated for 2022 🚀!

Table of Contents

Software & Apps

Iterables, AsyncIterables, Observables, Oh My!

I know there is a lot of confusion around Observables, Iterables, AsyncIterables and AsyncObservables. Let's try to break this down and the reasons for each.

Pull versus Push Collections

When it comes to collections, you have two ways of thinking about collections, push versus pull. With pull, the consumer is in control of when you get the items, but with push, you get the values when the producer is ready.

Pull Based Collections