Skip to content

Instantly share code, notes, and snippets.

@TheJLifeX
TheJLifeX / 00-hand-gesture-recognition.gif
Last active August 26, 2025 07:06
Simple Hand Gesture Recognition Code - Hand tracking - Mediapipe
00-hand-gesture-recognition.gif
@xshifty
xshifty / gist:eff4a2c45d7a9eec534a047c4c7ac331
Created June 29, 2017 14:00
ffmpeg rtsp stream to mp4
ffmpeg -i rtsp://admin:admin@10.0.0.102:554/user=admin_password=tlJwpbo6_channel=1_stream=0.sdp?real_stream -rtsp_transport tcp -r 5 -t 20 -y -vf scale=800:-1 -c:v libx264 -crf 35 -preset veryfast -c:a aac -strict experimental -b:a 192k -ac 2 output.mp4
@Gibgezr
Gibgezr / gist:0f403ee93a661bb01bbd
Last active February 26, 2020 11:00
C++ file operation snippets
//C++ copy files
#include <fstream>
std::ifstream src("from.ogv", std::ios::binary);
std::ofstream dst("to.ogv", std::ios::binary | std::ios::trunc);
dst << src.rdbuf();
/*
the one-liner:
std::ofstream(dest) << std::ifstream(src).rdbuf();
@Nimrodda
Nimrodda / JNI.cpp
Last active March 8, 2021 09:35
Raw JNI with async callbacks
static jclass callbacksClass;
static jobject callbacksInstance;
JNIEXPORT void JNICALL Java_com_example_NativeClass_nativeMethod(JNIEnv* env, jclass callingObject, jobject callbacks)
{
// Cache the Java callbacks instance
callbacksInstance = env->NewGlobalRef(callbacks);
// Cache the Java callbacks class (in case of interface, this will be the concrete implementation class)
jclass objClass = env->GetObjectClass(callbacks);
@cromandini
cromandini / universal-framework.sh
Last active September 13, 2025 02:41 — forked from cconway25/gist:7ff167c6f98da33c5352
This run script will build the iphoneos and iphonesimulator schemes and then combine them into a single framework using the lipo tool (including all the Swift module architectures).
#!/bin/sh
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal
# make sure the output directory exists
mkdir -p "${UNIVERSAL_OUTPUTFOLDER}"
# Step 1. Build Device and Simulator versions
xcodebuild -target "${PROJECT_NAME}" ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphoneos BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build
xcodebuild -target "${PROJECT_NAME}" -configuration ${CONFIGURATION} -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build
@gabrielfalcao
gabrielfalcao / tcp-socket-error-codes-errno.txt
Last active February 19, 2025 18:47
TCP socket error codes
0 = Success
1 = Operation not permitted
2 = No such file or directory
3 = No such process
4 = Interrupted system call
5 = Input/output error
6 = No such device or address
7 = Argument list too long
8 = Exec format error