Skip to content

Instantly share code, notes, and snippets.

View Qix-'s full-sized avatar
💻
Making an OS @oro-os

Josh Junon Qix-

💻
Making an OS @oro-os
View GitHub Profile
@Qix-
Qix- / main.rs
Created October 18, 2026 22:16
Resistor Calculator
// resistors.rs — build with: rustc -O resistors.rs
//
// Usage:
// resistors [--tol=PERCENT] [--max=PARTS] TARGET VALUE[:QTY] VALUE[:QTY] ...
//
// Example:
// resistors 22100 10:50 20:50 47:50 100:50 220:50 470:50 1000:50 2200:50 ...
//
// Finds a series/parallel network of the available resistors whose
// equivalent resistance is within --tol percent (default 1%) of TARGET,
@Qix-
Qix- / ohai.gif
Last active July 7, 2026 13:46
ohaider
ohai.gif
@info[en-US] Simple media controller input device
@info[de-DE] Einfaches Mediencontroller-Eingabegerät
@info[ja-JP] シンプルなメディアコントローラー入力デバイス
@info[fr-FR] Périphérique d'entrée de contrôleur multimédia simple
@info[pt-PT] Dispositivo de entrada de controlador de mídia simples
@info[zh-CN] 简单的媒体控制器输入设备
@info[es-ES] Dispositivo de entrada de controlador de medios sencillo
@info[ko-KR] 간단한 미디어 컨트롤러 입력 장치
@info[tr-TR] Basit medya denetleyici giriş cihazı
@info[ar-SA] جهاز إدخال للتحكم في الوسائط بسيط
use cassowary::{Constraint, Solver, Variable, WeightedRelation::*, strength::*};
use std::{
collections::HashMap,
sync::{Arc, Mutex, mpsc},
};
use thread_pool::Task;
const MIN_CLOCK: f64 = 165.0;
const CLK48_ERR: f64 = 0.001;
const MIN_PCLK1: f64 = 42.0;
@Qix-
Qix- / sha256.sh
Last active February 15, 2025 07:24
SHA256 in (mostly) pure Bash script
#!/usr/bin/env bash
# Released into the Public Domain.
#
# Original implementation in C by Brad Conte (brad@bradconte.com) <https://github.com/B-Con/crypto-algorithms>
# Ported to Bash (lol) by Josh Junon (josh@junon.me) <https://github.com/qix->
#
# Yes, it's absolutely as slow as it looks.
#
# The only external dependency it has is on a utility called `od`,
@Qix-
Qix- / sudoku.js
Last active February 10, 2025 13:17
const board = `
_ _ _ _ _ _ _ 3 _
_ _ _ _ _ _ _ _ 6
_ 3 _ _ _ _ _ _ _
_ _ 1 _ _ _ _ _ _
_ _ _ _ _ _ _ _ _
_ _ _ 3 _ _ _ _ _
_ _ _ _ 1 _ _ _ _
@Qix-
Qix- / coro.cpp
Created September 29, 2020 04:16
C++20 coroutines + LibUV sample, v2
// Thank you to the folks at the C++ slack channel,
// along with @lewissbaker for the excellent literature
// (even though it took me a few days to be convinced
// it really was so).
#include <uv.h>
#include <iostream>
#include <experimental/coroutine>
@Qix-
Qix- / scurl.sh
Last active November 27, 2024 23:24
Safe cURL - pipe your cURL-obtained scripts into this and pass it a sha256 to verify against. Comes with a pure-bash sha256 implementation.
#!/usr/bin/env bash
# Usage: curl https://some-site-with-potential-mitm.com/script.sh | scurl $verified_sha256_digest_of_script
# Released into the Public Domain.
# Written by Josh Junon (josh@junon.me) <github.com/qix->
# Original SHA256 implementation in C by Brad Conte (brad@bradconte.com) <https://github.com/B-Con/crypto-algorithms>
# Ported to (almost) pure Bash by Josh Junon
@Qix-
Qix- / gdb.rs
Created July 22, 2024 00:32
GDB Remote Protocol Client in Rust + Tokio
//! Hi. I was going to use this to make some debug tooling for my OS
//! but I instead opted to ditch the direct connection to QEMU's GDB server
//! and instead wrap a GDB executable using the machine-readable interface.
//!
//! I didn't want to throw this away though, so if you can find some use for
//! it, by all means go for it.
//!
//! Released under CC0 or Public Domain or MIT, whatever you want.
//!
//! - Josh
@Qix-
Qix- / readme.md
Last active March 30, 2024 10:29

This is a diff between the xz-embedded repositories listed on github and at git.tukaani.org.

$ git remote -v
github  https://github.com/tukaani-project/xz-embedded (fetch)
github  https://github.com/tukaani-project/xz-embedded (push)
origin  https://git.tukaani.org/xz-embedded.git (fetch)
origin  https://git.tukaani.org/xz-embedded.git (push)