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
Last active January 9, 2024 22:27
static link ffmpeg
# Download msys2 from https://www.msys2.org/ and open ucrt64 terminal
TARGET=$(pwd)/rust-ffmpeg1
REPO=https://github.com/zmwangx/rust-ffmpeg
FFMPEG_NAME=ffmpeg-n6.1-latest-win64-gpl-shared-6.1
FFMPEG_SRC_PREFIX=latest
FFMPEG_SRC=https://github.com/BtbN/FFmpeg-Builds/releases/download/$FFMPEG_SRC_PREFIX/$FFMPEG_NAME.zip

git clone $REPO $TARGET
if [ ! -d $TARGET/$FFMPEG_NAME ]; then
# Contributer: thewh1teagle
_realname=pico-sdk
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=1.5.1
pkgrel=1
pkgdesc="Libraries for C/C++ development on RP2040 microcontrollers."
arch=("any")
mingw_arch=("mingw64" "ucrt64" "clang64")
# Contributer: thewh1teagle
_realname=pico-sdk
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=1.5.1
pkgrel=1
pkgdesc="Libraries and tools for C/C++ development on RP2040 microcontrollers."
arch=("any")
mingw_arch=("mingw32" "mingw64" "ucrt64" "clang64" "clang32")
@thewh1teagle
thewh1teagle / README.md
Created December 31, 2023 17:41
Build faiss on windows in msys2
  1. Download msys2 from https://www.msys2.org/
  2. Install dependencies
pacman --needed -S $MINGW_PACKAGE_PREFIX-{toolchain,cmake,make,swig,autotools,lapack} git
  1. Clone & Build
git clone https://github.com/facebookresearch/faiss
cd faiss
@thewh1teagle
thewh1teagle / README.md
Last active December 31, 2023 14:22
Setup Raspberry PI Pico SDK in 5 minutes

Download msys2 from https://www.msys2.org/

Open MSYS2 UCRT64 terminal

Install dependencies (always use ucrt packages in ucrt terminal not mingw packages, when possible)

pacman --needed -S $MINGW_PACKAGE_PREFIX-{toolchain,cmake,libusb,arm-none-eabi-toolchain,make} git

Clone Repos

@thewh1teagle
thewh1teagle / main.py
Created December 28, 2023 23:57
enumerate devices pyserial
import os
import serial
if os.name == 'nt': # sys.platform == 'win32':
from serial.tools.list_ports_windows import comports
elif os.name == 'posix':
from serial.tools.list_ports_posix import comports
ports = comports()
for port in ports:
@thewh1teagle
thewh1teagle / fake_device.py
Last active December 23, 2023 16:24
Baud Rate Detector
import os
import pty
import time
import random
import string
import termios
# Create a pair of pseudo-terminals (PTYs)
master, slave = pty.openpty()
name = os.ttyname(slave) # Use master, not slave
@thewh1teagle
thewh1teagle / websockets_chat.rs
Created December 19, 2023 23:02
Warp example of websockets_chat with struct and impl
// #![deny(warnings)]
use std::collections::HashMap;
use std::sync::{
atomic::{AtomicUsize, Ordering},
Arc,
};
use futures_util::{SinkExt, StreamExt, TryFutureExt};
use tokio::sync::{mpsc, RwLock};
use tokio_stream::wrappers::UnboundedReceiverStream;
@thewh1teagle
thewh1teagle / tailwind.config.js
Last active December 11, 2023 23:33
DaisyUI Material UI theme
/** @type {import('tailwindcss').Config} */
export default {
content: [
"./index.html",
"./src/**/*.{js,ts,jsx,tsx}",
],
darkMode: ["class", '[data-theme="dark"]'],
theme: {
extend: {},
},
@thewh1teagle
thewh1teagle / dark.css
Created December 11, 2023 22:29
material ui pallete
--muidocs-palette-primary-50: #F0F7FF;
--muidocs-palette-primary-100: #C2E0FF;
--muidocs-palette-primary-200: #99CCF3;
--muidocs-palette-primary-300: #66B2FF;
--muidocs-palette-primary-400: #3399FF;
--muidocs-palette-primary-500: #007FFF;
--muidocs-palette-primary-600: #0072E5;
--muidocs-palette-primary-700: #0059B2;
--muidocs-palette-primary-800: #004C99;
--muidocs-palette-primary-900: #003A75;