Skip to content

Instantly share code, notes, and snippets.

#include <iostream>
/*
./bootstrap.sh --with-libraries=filesystem,url
./b2 -j4 link=static variant=release cxxflags="-O3 -ffunction-sections -fdata-sections"
g++ -O3 -Wall -Wextra -I. ../boost_misc.cpp -o ../boost_misc -Lstage/lib -lboost_filesystem -lboost_url -s -Wl,--gc-sections
*/
/* generate UUID (header-only) */
#include <boost/lexical_cast.hpp>
@darealshinji
darealshinji / zelotes-c12-data.txt
Created December 27, 2023 01:42
Zelotes C-12 Gaming USB Mouse data
#define USB_VENDOR_ID 0x12c9
#define USB_PRODUCT_ID 0x1028
Class-Specific Request (DOWN)
Destination: Interface, Index 2
Reserved Bits: 34
Request: 0x9
Value: 0x300
@darealshinji
darealshinji / glibc-version.c
Last active October 27, 2023 22:54
find the highest version GLIBC_* symbol in a file or directory
/* Public Domain code */
/* find the highest version GLIBC_* symbol in a file or directory */
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include <ctype.h>
#include <elf.h>
#include <fcntl.h>
/***
Copyright (c) 2023 AppImage Community
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@darealshinji
darealshinji / mis2x264.sh
Last active May 2, 2023 20:54
Convert MediaInfo encoding settings to x264 commands
#!/bin/sh
if [ -z "$1" ] ; then
echo "Convert MediaInfo encoding settings to x264 commands"
echo "Usage: $0 <video>"
echo " $0 \"MediaInfo encoding settings\""
exit 0
fi
Opt:
-O0 -Od
-O2 -O2 -Ot
-O3 -Ox -Ot
-Os -O1 -Os
-fomit-frame-pointer -Oy
Code gen:
-f[no-]rtti -gr[-]
Patch for coreutils 9.1 to copy a directory with a progress shown.
Better alternative: https://github.com/dmerejkowsky/pycp
--- a/src/copy.c
+++ b/src/copy.c
@@ -1815,16 +1815,80 @@
&& ! overwrite_ok (x, dst_name, dst_dirfd, dst_relname, dst_sb)));
}
+// GPL3, Copyright (C) 2016 Xfennec, CQFD Corp.
+// https://github.com/Xfennec/progress/blob/master/sizes.c
// MIT License
// Copyright (c) 2021 djcj <djcj@gmx.de>
// Elf file parsing code was taken from https://github.com/finixbit/elf-parser
// Copyright (c) 2018 finixbit
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
#!/bin/bash
# build-dependencies: mono-devel subversion imagemagick
# build system: Ubuntu 16.04
set -e
set -x
export LANG=C
APP="gMKVExtractGUI"
from_source=yes
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <float.h>
#include <inttypes.h>
#include "nanosvg.h"
#define NANOSVGRAST_IMPLEMENTATION
#include "nanosvgrast.h"
#define STB_IMAGE_WRITE_IMPLEMENTATION
#include "stb_image_write.h"