Skip to content

Instantly share code, notes, and snippets.

View shamansir's full-sized avatar
💭
Noodling

Ulric Wilfred shamansir

💭
Noodling
View GitHub Profile
@shamansir
shamansir / README.md
Created January 12, 2026 19:47
Conway's Life in Terminal, by ChatGPT
npm i -D ts-node typescript @types/node
npx ts-node life-terminal.ts
@shamansir
shamansir / commands.txt
Last active January 22, 2026 01:44
StreamDiffusion install on MacOS M1
# MacOS
# With 3.0, Installing from the interface
# Ensure the folder contains the repo from `dotultimate/SDTD_v3_stable` or my fork
# Ensure no other folder inside at `/Users/shamansir/stable-diffusion-td/StableDiffusion`
#. (or how component is configured) or from previous installs
sudo rm -r ./StreamDiffusion/venv
source venv/bin/activate
pip3 freeze > requirements-from-touchdesigner-frozen.txt
pip3 install python-osc
module Main where
import Prelude
import Effect (Effect)
import Effect.Console (log)
main
:: Effect Unit
main = do
@shamansir
shamansir / Pairs.purs
Last active June 14, 2023 12:20
PureScript Records Pairing
module Data.Record.Pairs where
import Prelude
import Data.Symbol (class IsSymbol)
import Prim.RowList as RL
class Pairs (xsA :: RL.RowList Type) (xsB :: RL.RowList Type)
@shamansir
shamansir / purs-typeclasses.cue
Last active May 15, 2021 10:46
PureScript typeclasses in CUE -> JSON, for https://imgur.com/a/ESOR7
plus: {
name: "Plus"
info: "Left and Right identity for Alt"
parent: "alt"
"package": "Control*"
members:
[
{ name: "empty"
, def: "f a"
, laws : // FIXME: laws are incorrect
@shamansir
shamansir / FromHex.elm
Last active May 3, 2021 20:07
Color from Hex in Elm
module FromHex exposing (..)
import Color exposing (Color)
hexToColor : String -> Result String Color
hexToColor str =
let
digitToInt digit =
case digit of
@shamansir
shamansir / backloggery_load_games.js
Last active August 16, 2021 09:30
Load games list as JSON From Backloggery page
let games = Array.from(document.getElementsByClassName('gamebox'));
function loadTitle(gamebox) {
if (!gamebox) return null;
return gamebox.querySelector('h2 b') ? gamebox.querySelector('h2 b').textContent.trim() : null;
}
function isNowPlaying(gamebox) {
return gamebox.classList.contains('nowplaying');
}
@shamansir
shamansir / macOSVideoScreenSaver.md
Last active July 17, 2025 09:34
Installing video file as a screensaver on macOS

Based on this article: https://workspacevita.com/how-to-use-own-videos-screensavers-mac-catalina/

The difference is that the Aerial Configuration screens shown there are outdated.

First, you need to prepare the video file so it would be visible to Aerial. Due to security.

  1. Create /Users/Shared/screensavers folder.
  2. Put a copy of your video file to /Users/Shared/screensavers.
  3. That should be enough.
@shamansir
shamansir / BinPack.elm
Created August 26, 2020 07:09
Elm 2D Bin Packing
module BinPack exposing (..)
import Browser
import Html exposing (Html, button, div, text, input)
import Html.Attributes as H exposing (..)
import Html.Events exposing (onClick)
import Random
import Svg exposing (..)
import Svg.Attributes as S exposing (..)
@shamansir
shamansir / Main.elm
Last active August 14, 2020 08:49
Elm program quick template
module Main exposing (..)
import Browser
import Html exposing (Html)
import Html as H
type alias Flags = ()