Skip to content

Instantly share code, notes, and snippets.

@yosun
yosun / install.models.etc.py
Last active August 10, 2025 00:52
python ~/ComfyUI/_install.models.etc.py [path to workflow.json] <br> installs all missing models and lets you insert civitai key if needed <br> extract workflow from image using https://absurdity.ai/comfyui/image2workflowjson.html
import json
import os
import sys
import requests
MODELS_BASE_DIR = os.path.join("ComfyUI", "models")
def download_file(url, directory, filename, civitai_key=None, hf_token=None):
target_dir = os.path.join(MODELS_BASE_DIR, directory)
os.makedirs(target_dir, exist_ok=True)
# configure the docker repository
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \
&& curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \
sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
# update the repository
sudo apt-get update
# Install the NVIDIA Container Toolkit packages:
@yosun
yosun / VideoKitRecorder.cs
Created June 12, 2025 06:09
fix for editor recording test
/*
* VideoKit
* Copyright © 2024 Yusuf Olokoba. All Rights Reserved.
*/
#nullable enable
namespace VideoKit {
using System;
@yosun
yosun / MoGe2UnityMatching.cs
Created May 27, 2025 08:58
places image quad at position of MoGe glb in Unity https://github.com/microsoft/MoGe
using UnityEngine;
public class MoGe2UnityMatching : MonoBehaviour
{
public GameObject goTestMesh;
public Texture2D goTestImage;
public Material matImageQuadMaterial;
void Start()
using UnityEngine;
using OpenCVForUnity.CoreModule;
using OpenCVForUnity.ImgprocModule;
using OpenCVForUnity.UnityUtils;
using OpenCVForUnity.VideoioModule;
using System.Collections.Generic;
public class LowRankWebcam : MonoBehaviour
{
VideoCapture capture;

I found out on June 27, 2024 that my best friend Chieu passed away.

What are the odds of a CH-named Vietnamese refugee born in Lugano (in a rare Italian-speaking canton) of Switzerland who would later migrate to Houston - meeting a (norcal) valley girl mad-scientist-entrepreneur born in Taiwan with a Turkish name of Yosun - at Google I/O of all conferences on June 26, 2014?

Being more of the intrepid indie type at this point, my friends were starving artists and hungry hackers - not Googlers or suits. But albeit having made it to noogler status, Chieu would be poor for a bit longer. Shortly after, Chieu began her 9 month long waiting period as Google struggled to figure out how to place such undefinable brilliance.

Chieu followed me to her first hackathon, where I made fun of her for being the "useless girlfriend at a hackathon, watching anime in a corner." Somehow I convinced her to learn (something perhaps a bit too hackneyed practical for her obscure puzzling likes) a frontend javascript UI framework

@yosun
yosun / yc_love.py
Last active July 1, 2024 08:33
Another Ycombinator and LOVE - in reminiscing an old blog post from my late friend Chieu Nguyen (the scheme and postscript versions are also @ ) https://minimonimania.wordpress.com/2008/12/03/yajima-combinator/
# (printing “LOVE” an infinite number of times using named recursion in Python)
def FOREVER(x):
print x,
FOREVER(x)
FOREVER("LOVE")
#(the Y combinator in Python)
(lambda f: \
(lambda x: f(lambda y: (x(x))(y))) \
@yosun
yosun / TextToTextMeshPro.cs
Last active June 27, 2024 00:15
Unity editor script converts Unity UI Text to TMP TextMeshPro text - tested in 2022.3.33f1 for VisionOS Polyspatial proj - with font mod https://forum.unity.com/threads/replacing-text-with-textmesh-pro.515594/#post-8339880
using UnityEngine;
using UnityEditor;
using UnityEngine.UI;
using TMPro;
public class TextToTextMeshPro : Editor
{
public class TextMeshProSettings
{
public bool Enabled;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using PolySpatial.Samples;
public class ModelProcessorPolyspatial : MonoBehaviour
{
public Vector3 rotationAxis = new Vector3(0,42,0);
@yosun
yosun / bw-face-landmarker-on-white-bg-for-sajjad.markdown
Created June 15, 2024 07:40
bw face landmarker on white bg for Sajjad