Skip to content

Instantly share code, notes, and snippets.

View thewh1teagle's full-sized avatar
💭
coding

thewh1teagle

💭
coding
  • localhost
  • The martian
View GitHub Profile
@thewh1teagle
thewh1teagle / README.md
Created January 27, 2024 16:26
stream ffmpeg to web

Stream rtsp to web using ffmpeg and mediamtx

#!/bin/bash

name=mediamtx_v1.5.0_darwin_arm64
version=v1.5.0

vid_name=big_buck_bunny_720p_10mb.mp4
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Audio Player</title>
</head>
<body>
<h1>Audio Player</h1>
@thewh1teagle
thewh1teagle / mac.to.pc.json
Created January 23, 2024 10:11
convert hotkeys from macos to PC like
{
"title": "PC-Style Shortcuts",
"rules": [
{
"description": "Home key to the beginning of the line (Control + a)",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "home",
use anyhow::{Result, Ok};
use heed::{EnvOpenOptions, Env};
use arroy::{Database, Reader, Writer, ItemId};
use arroy::distances::DotProduct;
use std::borrow::BorrowMut;
use std::sync::Arc;
pub struct Engine {
db: Database<DotProduct>,
writer: Writer<DotProduct>,
use anyhow::{Result, Ok};
use heed::{EnvOpenOptions, Env};
use arroy::{Database, Reader, Writer, ItemId};
use arroy::distances::DotProduct;
use rand::SeedableRng;
use rand::rngs::StdRng;
use std::borrow::BorrowMut;
use std::sync::Arc;
pub struct Engine {
User@DESKTOP-HPEE9O3 UCRT64 ~/vibe/desktop/src-tauri
$ TARGET=pe-x86-64 RUST_BACKTRACE=full OPENBLAS_PATH=$MINGW_PREFIX PATH="/c/Program Files/nodejs:$PATH" cargo tauri build -c tauri.windows.conf.json
Running beforeBuildCommand `npm run build`
> [email protected] build
> tsc && vite build
vite v5.0.11 building for production...
transforming (7) node_modules\react-i18next\dist\es\index.js
🌼 daisyUI 4.5.0
@thewh1teagle
thewh1teagle / main.py
Last active January 13, 2024 22:05
Detect when internet back to be stable
import subprocess
import re
import time
import requests
import logging
import os
logging.basicConfig(level=os.getenv('LOG_LEVEL', 'INFO').upper())
logger = logging.getLogger()
@thewh1teagle
thewh1teagle / README.md
Created January 12, 2024 21:07
save bandwidth when developing msys2 package

A tip to save some bandwidth, you can edit /etc/pacman.info, uncomment

#CacheDir    = /var/cache/pacman/pkg/

and set it to your original msys2 installation (unix-path), for example

CacheDir    = /c/msys64/var/cache/pacman/pkg/
@thewh1teagle
thewh1teagle / readme.md
Created January 10, 2024 17:39
tauri msys2

PATH="/c/Program Files/nodejs:$PATH" cargo tauri dev

@thewh1teagle
thewh1teagle / README.md
Created January 10, 2024 17:03
Dumb init

here's the dumb way to do it :D,

const uint8_t dll_data[] = { /* dump the raw dll file data here */ };

typedef int (*SquareFn)(int);

int main()
{
    // create a dll file from the above dll_data
 HANDLE hFile = CreateFileA("a.dll", GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);