Skip to content

Instantly share code, notes, and snippets.

@subtleGradient
subtleGradient / TCR.sh.command
Last active December 27, 2023 01:21
Test && Commit || Revert
#!/bin/bash
set -e # exit on error
set -u # exit on undefined variable
# set -o pipefail # exit on failure in pipe
# set -x # print commands as they are run
# if DEBUG is set, print commands as they are run
set +u # allow undefined variables for this check
if [ ! -z "$DEBUG" ]; then
set -x
@subtleGradient
subtleGradient / GenAI.js
Created November 4, 2023 18:37
playing with ollama
class GenAI {
static INJECT = "<{([ INJECT ])}>"
static PRE = "<PRE>"
static SUF = " <SUF>"
static MID = " <MID>"
static END = " <EOT>"
#apiUrl
#model
@subtleGradient
subtleGradient / Bad.txt
Created November 3, 2023 15:23
TLDs that get linkified automatically by Apple Notes
These TLDs are NOT linkified automatically by Apple Notes
example.ac
example.actor
example.adult
example.ae
example.am
example.app
example.archi
example.army
@subtleGradient
subtleGradient / getter.py
Last active December 2, 2022 23:51
hack pyannote to work on M1/M2 macOS with arm64 with MPS
def get_devices(needs: int = None):
"""Get devices that can be used by the pipeline
Parameters
----------
needs : int, optional
Number of devices needed by the pipeline
Returns
-------
@subtleGradient
subtleGradient / search_youtube.py
Last active September 30, 2022 23:13
Command line python script to search YouTube
#!/usr/bin/env python3
import json
import os
def install():
os.environ['PYPPETEER_CHROMIUM_REVISION'] = '1052357'
os.system('python3 -m pip install -q pyppeteer pyppeteer_stealth')
os.system('pyppeteer-install')
import useSize, { UseSizeOptions } from "@react-hook/size";
import {
Fragment,
ReactNode,
RefObject,
useCallback,
useEffect,
useLayoutEffect,
useRef
} from "react";
@subtleGradient
subtleGradient / 42_hand-sketch-97.info.markdown
Last active September 6, 2021 14:35
42_hand-sketch-97.jpg Info

This was drawn by the textmode artist agent_42 (member of the CiA art group) It was sketched in 1997 after the artist graduated from vocational school for Desktop Publishing, his mom forced him to take a drawing class.

This was the first thing he ever drew in class. Not too shabby right?

42_hand-sketch-97

javascript:void(()=>[...document.querySelectorAll('.ui-block-a~script,.ui-block-a~center,.share,[data-role="content"][role="main"],[data-role="content"][role="main"]+.ui-grid-solo,.ui-block-a+div')].forEach(e=>e.parentNode.removeChild(e)))()
@subtleGradient
subtleGradient / command.js
Last active August 9, 2021 14:45 — forked from jonathantneal/command.js
Executable JavaScript Modules
":" /*prettier-ignore*/ //#;exec /usr/bin/env node --input-type=module - "$@" < "$0"
import process from "process";
const { argv } = process;
console.log(argv);
WEBVTT|(?<=^[A-Z][^.?!]+$)\n|^\d+.+align:center$| +|<[^>]+>|$\n\n