Skip to content

Instantly share code, notes, and snippets.

View shawnfeng0's full-sized avatar
💭
Keep thinking

Shawn Feng shawnfeng0

💭
Keep thinking
View GitHub Profile
@danigb
danigb / ffmpeg_sample_formats.txt
Last active March 30, 2025 14:47
ffmpeg sample formats
Source: https://forum.videohelp.com/threads/373264-FFMpeg-List-of-working-sample-formats-per-format-and-encoder
---------------------------------------------------------------------------------------------------------------
MP3 - MPEG Layer 3 Audio - Libmp3lame
sample_fmt="s16p,s32p,fltp"
AAC - Advanced Audio Coding - AAC (Advanced Audio Coding)
sample_fmt="fltp"
@gridhead
gridhead / al-wpa-setup.sh
Created May 16, 2021 03:45
Installing Arch Linux on Raspberry Pi with Immediate WiFi Access
#!/bin/sh
set -e
if [[ $# -ne 3 ]] ; then
echo "Usage: $0 </dev/disk> <ssid> <passphase>"
exit 1
fi
DISK="$1"
echo fs.inotify.max_user_watches=524288 | sudo tee /etc/sysctl.d/40-max-user-watches.conf && sudo sysctl --system
#include <random>
#include <sstream>
namespace uuid {
static std::random_device rd;
static std::mt19937 gen(rd());
static std::uniform_int_distribution<> dis(0, 15);
static std::uniform_int_distribution<> dis2(8, 11);
std::string generate_uuid_v4() {
@ppoffice
ppoffice / README.md
Last active April 16, 2025 04:30
Install Visual Studio Code (actually code-server) on Android
  1. Install Termux, an Android terminal emulator that provides a Linux execution environment and various tools.

  2. Update system packages in Termux:

    $ pkg update -y
@sorashi
sorashi / _readme.md
Last active December 26, 2023 05:01
Windows registry edit that adds Windows command-line (cmd), Powershell and optionally GIT Bash to directory context menu

Registry edit that allows you to add Windows command-line, Powershell and/or GIT Bash to explorer context menu. source

@looopTools
looopTools / Read File to std::vector<uint8_t> in C++
Created February 1, 2019 13:33
How to read a file from disk to std::vector<uint8_t> in C++
inline std::vector<uint8_t> read_vector_from_disk(std::string file_path)
{
std::ifstream instream(file_path, std::ios::in | std::ios::binary);
std::vector<uint8_t> data((std::istreambuf_iterator<char>(instream)), std::istreambuf_iterator<char>());
return data;
}
@Francesco149
Francesco149 / docker-cross-device-link.md
Last active October 27, 2023 08:51
docker error creating new backup file '/var/lib/dpkg/status-old': Invalid cross-device link
@fnky
fnky / ANSI.md
Last active April 24, 2025 13:43
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@ktnr74
ktnr74 / 99-android.rules
Created July 19, 2018 16:03
Universal udev rules file to set Android device permissions
# do not forget to run 'sudo udevadm control --reload-rules' after editing this file
ACTION!="add", GOTO="android_usb_rules_end"
SUBSYSTEM!="usb", GOTO="android_usb_rules_end"
ENV{DEVTYPE}!="usb_device", GOTO="android_usb_rules_end"
ENV{ID_SERIAL_SHORT}=="", GOTO="android_empty_serial"
ENV{ID_SERIAL_SHORT}=="0000:*", GOTO="android_empty_serial"
ENV{ID_SERIAL_SHORT}=="0123456789ABCDEF", GOTO="android_empty_serial"