Skip to content

Instantly share code, notes, and snippets.

View hatkidchan's full-sized avatar
💭
¯\_(ツ)_/¯

Casey hatkidchan

💭
¯\_(ツ)_/¯
View GitHub Profile
@artsi0m
artsi0m / com.c
Last active February 11, 2024 17:16
Modified Tom Duff's com. (Original http://www.iq0.com/duffgram/com.c)
/*% cc -O0 -g % -o #
* com [-n] [file ...]
* looks for the sequence /*% in each file, and sends the rest of the
* line off to the shell, after replacing any instances of a `%' character
* with the filename, and any instances of `#' with the filename with its
* suffix removed. Used to allow information about how to compile a program
* to be stored with the program. The -n flag causes com not to
* act, but to print out the action it would have taken.
*
* This version of com would also create compile_flags.txt for clangd if
@CSaratakij
CSaratakij / README.txt
Last active April 4, 2024 20:57
Video Wallpaper (hw-accelerate) : Use 'mpv' as a video player backend with 'xwinwrap' to wrap our window to be use as a desktop background
You want to use a live wallpaper in x11?
Great!!...but It come as a cost.
I did experiment with .gif backend and non hardware accelerate backend, It sucks.
CPU usage was so high (40% up just for idle), unacceptable for my laptop.
Running with those backend for such a really long time will slowly turn your laptop into the hot potato.
But don't be upset, we can reduce those cost.
Using the video player with hardware video decoding support can reduce the cost.
@MightyPork
MightyPork / utf8_encode.c
Last active February 28, 2024 08:07
C function to encode a Unicode code point as UTF-8 byte array
#include <stdint.h>
/**
* Encode a code point using UTF-8
*
* @author Ondřej Hruška <ondra@ondrovo.com>
* @license MIT
*
* @param out - output buffer (min 5 characters), will be 0-terminated
* @param utf - code point 0-0x10FFFF
@TomScotch
TomScotch / ffrec.sh
Created October 6, 2016 21:51
record framebuffer with ffmpeg
ffmpeg -f fbdev -i /dev/fb0 -r 24 -c:v libx264 -b:v 500k output.avi