Skip to content

Instantly share code, notes, and snippets.

@OutThisLife
OutThisLife / README.md
Created July 23, 2026 18:12
Hermes worktree-aware launchers (hermes / htui / hgui) — run Hermes from any git worktree without a full per-worktree reinstall

Hermes worktree-aware launchers (hermes / htui / hgui)

Run Hermes from any git worktree without a full per-worktree reinstall.

A git worktree only carries tracked files, so a fresh worktree has no node_modules (~1.3G) and no .venv. These launchers make a worktree runnable by sharing the main checkout's deps when they're byte-identical, and falling back to a local install (stamped, so it only reinstalls when the lockfile actually changes) when the branch bumps a dependency.

@OutThisLife
OutThisLife / 37-gh.zsh
Last active July 30, 2026 04:55
BB Workflows
# gh: auto-pin default repo when a clone has multiple remotes.
# Without this, `gh pr checkout N` fails with "No default remote repository".
# Preference: origin → upstream → first github.com remote. Silent + once per repo.
_gh_ensure_default() {
git rev-parse --is-inside-work-tree >/dev/null 2>&1 || return 0
git config --get-regexp '^remote\..*\.gh-resolved$' >/dev/null 2>&1 && return 0
local remote
for remote in origin upstream; do
@OutThisLife
OutThisLife / useLinkableControls.ts
Last active February 24, 2025 00:56
Linkable leva controls (hydrates on mount and updates on value changes)
import { $layers } from '@/store'
import { levaStore } from 'leva'
import LZUTF8 from 'lzutf8'
import { useEffect } from 'react'
let hydrated = false
export default function useLinkableControls() {
const store = levaStore.useStore()
@OutThisLife
OutThisLife / useSmoothControls.ts
Last active February 6, 2025 18:07
useSmoothControls - smoothed leva using gsap
import gsap from 'gsap'
import { buttonGroup, useControls } from 'leva'
import { useMemo, useState } from 'react'
export function useSmoothControls<T extends Record<string, any>>(
label?: string,
initialArgs?: T,
options?: Parameters<typeof useControls>[2],
duration = 0.35
) {
[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1
[Metadata]
Name=ForexFactoryCalendar
Author=Talasan Nicholson
Version=0.1
import withData from '@/lib/withData'
import { ApolloClient } from 'apollo-boost'
import App, { AppProps, Container } from 'next/app'
import { ApolloProvider } from 'react-apollo'
export default withData(
class extends App<MyAppProps> {
public static async getInitialProps({ Component, ...ctx }) {
let pageProps = {}
import { spawn } from 'child_process'
import * as express from 'express'
import * as LRU from 'lru-cache'
const app = express()
const cache = LRU({
max: 152,
maxAge: 36e2
})
import { ApolloServer } from 'apollo-server-express'
import * as express from 'express'
import { IResolvers } from 'graphql-tools'
import * as LRU from 'lru-cache'
import typeDefs, { Context } from './types'
const router = express.Router()
const resolvers: IResolvers<{}, Context> = {
@OutThisLife
OutThisLife / server.ts
Last active November 28, 2018 03:44
server.ts
import * as compression from 'compression'
import * as express from 'express'
import { RequestHandlerParams } from 'express-serve-static-core'
import * as helmet from 'helmet'
import * as LRU from 'lru-cache'
import * as morgan from 'morgan'
import * as next from 'next'
import * as path from 'path'
const dev = process.env.NODE_ENV !== 'production'
@OutThisLife
OutThisLife / adx.ts
Created November 27, 2018 14:14
shopster_adx
declare lower;
declare once_per_bar;
input n = 14;
def gd_88 = high - high[1];
def gd_96 = low[1] - low;
def gda_104;
def gda_108;