Skip to content

Instantly share code, notes, and snippets.

# Step 0: Ensure .cache and .local link are symlinks
if [ ! -L ~/.cache ]; then
# create the directory if it doesn't exist
mkdir -p /vast/${USER}/.cache
ln -s /vast/${USER}/.cache ~/.cache
if [ ! -L ~/.local ]; then
# Define the installation path
# create directory if it doesn't exist
mkdir -p "${INSTALL_PATH}"
# create comfyui_models.txt if it doesn't exist
if [ ! -f "${INSTALL_PATH}/comfyui_models.txt" ]; then
# get the default modles file from gist:
curl -s > "${INSTALL_PATH}/comfyui_models.txt"
# Stable Cascade
# dir=models/checkpoints
# out=stable_cascade_stage_c.safetensors
# dir=models/checkpoints
# out=stable_cascade_stage_b.safetensors
# dir=models/controlnet
venetanji / ndi-asyncio
Last active December 12, 2023 16:54
ndi asyncio opencv
import sys
import numpy as np
import cv2 as cv
import NDIlib as ndi
import re
import asyncio
from pythonosc import udp_client
from facenet_pytorch import MTCNN
from hsemotion.facial_emotions import HSEmotionRecognizer
import torch
import cv2
import asyncio
import time
# open camera and get video capture object
cap = cv2.VideoCapture(0, cv2.CAP_DSHOW)
# set camera resolution
cap.set(cv2.CAP_PROP_FRAME_WIDTH, 1280)
cap.set(cv2.CAP_PROP_FRAME_HEIGHT, 720)
Esp8266 Websockets Client
This sketch:
1. Connects to a WiFi network
2. Connects to a Websockets server
3. Sends the websockets server a message ("Hello Server")
4. Prints all incoming messages while the connection is open
const tf = require('@tensorflow/tfjs-node-gpu');
const cv = require("@u4/opencv4nodejs");
const posenet = require("@tensorflow-models/posenet")
let camera = new cv.VideoCapture(0);
camera.set(cv.CAP_PROP_FRAME_WIDTH, 640);
camera.set(cv.CAP_PROP_FRAME_HEIGHT, 480);
async function loadPosenet() {
net = await posenet.load({
#include <Arduino.h>
#ifdef ESP32
#include <WiFi.h>
#include "SPIFFS.h"
#include <ESP8266WiFi.h>
#include "AudioFileSourceSPIFFS.h"
#include "AudioGeneratorMP3.h"
#include "AudioOutputI2S.h"
#include <ESP8266WiFi.h>
#include <ArduinoWebsockets.h>
// include wpa2 enterprise code
extern "C" {
#include "user_interface.h"
#include "wpa2_enterprise.h"
// SSID, Username and password. Update with yours!
venetanji / gist:3937545
Created October 23, 2012 08:03
Syncable class
class Syncable
include Mongoid::Document
field :url
field :method, default: :get
field :query
field :body
field :headers, default: {}
field :callback_class, default: :syncable
field :callback_method, default: :default