Skip to content

Instantly share code, notes, and snippets.

View ryuukk's full-sized avatar

ryuukk

View GitHub Profile
var path = string.ptr2str_len(MOD.memory.buffer, offset, len);
var req = new XMLHttpRequest();
req.open("GET", path, true);
req.responseType = "arraybuffer";
req.onload = function (evt) {
var arrayBuffer = req.response; // Note: not req.responseText
if (arrayBuffer)
{
var byteArray = new Uint8Array(arrayBuffer);
var path = string.ptr2str_len(MOD.memory.buffer, offset, len);
var req = new XMLHttpRequest();
req.open("GET", path, true);
req.responseType = "arraybuffer";
req.onload = function (evt) {
var arrayBuffer = req.response; // Note: not req.responseText
if (arrayBuffer)
{
var byteArray = new Uint8Array(arrayBuffer);
#include <stdio.h>
int main()
{
for(unsigned int i = 0; i< 1024; i++)
{
unsigned int size = i * 4;
unsigned int bucket = (__builtin_clz(size - 1) ^ 31) + 1;
clang --target=wasm32 -std=c99 -emit-llvm -c main.c
llc -march=wasm32 -filetype=obj main.bc
wasm-ld --no-entry --export-all --allow-undefined -o test.wasm main.o
@ryuukk
ryuukk / ws-client.cpp
Created December 20, 2021 05:06 — forked from optman/ws-client.cpp
libevent websocket client test
#include <event2/bufferevent.h>
#include <event2/buffer.h>
#include <event2/event.h>
#include <event2/dns.h>
#include <arpa/inet.h>
#include <iostream>
using namespace std;
@ryuukk
ryuukk / loudness.json
Last active November 16, 2022 21:12
EasyEffects Loudness preset
{
"output": {
"bass_enhancer#0": {
"amount": 5.0,
"blend": 0.0,
"bypass": false,
"floor": 20.0,
"floor-active": false,
"harmonics": 8.5,
"input-gain": 0.0,
bass_enable=false
bass_maxgain=5
compression_aggressiveness=10
compression_enable=false
compression_maxatk=0
compression_maxrel=195
convolver_enable=false
convolver_file=""
convolver_optimization_mode=0
convolver_waveform_edit="-80;-100;0;0;0;0"
module rt.rand;
int rand_range(int min, int max)
{
return (min == max) ? min : (min + (gen_rand_uint(&_r) % (max+1 - min)));
}
double rand_range(double min, double max)
{
@ryuukk
ryuukk / chromium-font_gamma_fix_font.patch
Last active June 6, 2022 09:24
Fix chrome's font rendering gamma issue with a single patch!
diff --git a/skia/BUILD.gn b/skia/BUILD.gn
index 5c3a90ee..e59abc5 100644
--- a/skia/BUILD.gn
+++ b/skia/BUILD.gn
@@ -150,7 +150,7 @@
}
# Settings for text blitting, chosen to approximate the system browser.
- if (is_linux || is_chromeos) {
+ if (is_chromeos) {
[ryuukk@ark conf.d]$ ll
total 52
drwxr-xr-x 2 root root 4096 Apr 23 15:08 .
lrwxrwxrwx 1 root root 50 Mar 6 11:45 10-symbols.conf -> /usr/share/fontconfig/conf.default/10-symbols.conf
lrwxrwxrwx 1 root root 71 Mar 6 06:59 20-unhint-small-dejavu-lgc-sans.conf -> /usr/share/fontconfig/conf.default/20-unhint-small-dejavu-lgc-sans.conf
lrwxrwxrwx 1 root root 76 Mar 6 06:59 20-unhint-small-dejavu-lgc-sans-mono.conf -> /usr/share/fontconfig/conf.default/20-unhint-small-dejavu-lgc-sans-mono.conf
lrwxrwxrwx 1 root root 72 Mar 6 06:59 20-unhint-small-dejavu-lgc-serif.conf -> /usr/share/fontconfig/conf.default/20-unhint-small-dejavu-lgc-serif.conf
lrwxrwxrwx 1 root root 67 Mar 6 06:59 20-unhint-small-dejavu-sans.conf -> /usr/share/fontconfig/conf.default/20-unhint-small-dejavu-sans.conf
lrwxrwxrwx 1 root root 72 Mar 6 06:59 20-unhint-small-dejavu-sans-mono.conf -> /usr/share/fontconfig/conf.default/20-unhint-small-dejavu-sans-mono.conf
lrwxrwxrwx 1 root root 68 Mar 6 06:59 20-unhint-small-dejavu-se