Skip to content

Instantly share code, notes, and snippets.

local SECS = 5;
local function Min(x, y) {
if (x < y)
return x;
return y;
}
local function Max(x, y) {
if (x > y)
return x;
@SpencerLeung1024
SpencerLeung1024 / notes_on_lcm_loras_with_openvino_stable_diffusion.md
Last active February 18, 2024 22:27
Observations from using LCM LoRAs with openvinotoolkit/stable-diffusion-webui.
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
typedef unsigned int uint;
#ifndef PICO_PLL_VCO_MIN_FREQ_MHZ
#define PICO_PLL_VCO_MIN_FREQ_MHZ 750
#endif
#ifndef PICO_PLL_VCO_MAX_FREQ_MHZ
@fusetim
fusetim / protonvpn-wireguard-generator.py
Last active July 24, 2024 17:28
Generate lots of Wireguard configuration for your ProtonVPN Account.
import http.client
import http.cookies
import json
import base64
import hashlib
from cryptography.hazmat.primitives import serialization
from cryptography.hazmat.primitives.asymmetric import x25519
from cryptography.hazmat.primitives.asymmetric import ec
from cryptography.hazmat.primitives import hashes
@andrewrk
andrewrk / zig-perf.md
Last active July 10, 2022 09:14
some measurements of zig self-hosted compiler perf

Building a debug build of Zig:

zig build -Dskip-install-lib-files

Measurements taken on:

  • Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
  • 0.10.0-dev.2381+39ebfedd2

stage1

@columbarius
columbarius / debug-pipewire-screencast.sh
Last active August 17, 2023 07:43
PipeWire Screencast Info
#!/bin/sh
pw-dump | jq -r '[.[] | select(.info.props."node.name" | IN("firefox","gnome-shell","kwin_wayland","obs","xdg-desktop-portal-wlr","xdp-screencast.py")) | .id] as $pw_node_ids | [ .[] | select(.info.props."node.id" | IN($pw_node_ids[])) | .id ] as $pw_port_ids | .[] | select(.id | IN(($pw_node_ids + $pw_port_ids)[]))'
@mitchellh
mitchellh / Atlas.zig
Last active March 8, 2024 03:10
Bin-packed texture atlas implementation in Zig. https://en.wikipedia.org/wiki/Texture_atlas
//! Implements a texture atlas (https://en.wikipedia.org/wiki/Texture_atlas).
//!
//! The implementation is based on "A Thousand Ways to Pack the Bin - A
//! Practical Approach to Two-Dimensional Rectangle Bin Packing" by Jukka
//! Jylänki. This specific implementation is based heavily on
//! Nicolas P. Rougier's freetype-gl project as well as Jukka's C++
//! implementation: https://github.com/juj/RectangleBinPack
//!
//! Limitations that are easy to fix, but I didn't need them:
//!
@fakuivan
fakuivan / tplink_tlsg108e_v1_config_backup.md
Created February 20, 2022 20:07
TP-Link TL-SG108E V1 config backup format
AMD Ryzen 7 5700G with Radeon Graphics
@iszn11
iszn11 / image.zig
Last active August 4, 2021 10:39
PNG decoder based on stb_image.h implementation.
const std = @import("std");
const ArrayList = std.ArrayList;
const Allocator = std.mem.Allocator;
// PNG decoder based on stb_image.h implementation, including zlib decompressor. A bit more zig-friendly than original. Compared to
// stb_image.h:
// - only decodes from a slice (filename or callbacks not supported)
// - only decodes to 8-bit channels (any other bit depth is converted, no decoding to 16-bit or float samples)
// - requires an allocator (zig style)
// - doesn't support interlaced images