Skip to content

Instantly share code, notes, and snippets.

View krovma's full-sized avatar
🏋️‍♂️
Working

Krovma krovma

🏋️‍♂️
Working
  • Shanghai
View GitHub Profile
@krovma
krovma / README.md
Created September 23, 2024 06:32 — forked from jamiephan/README.md
A script to automatically add ALL items to your account in quixel

Script to add all items from quixel

As quixel is being removed, all items are free to aquire. This script is to automate the process to add items to your account (As of writing, a total of 18874 items)

Note: This script only tested in the latest version of Chrome.

How to use

  1. Copy the script from below (run.js)
  2. Login into https://quixel.com
@krovma
krovma / relativeLuminanceW3C.js
Created July 25, 2023 08:08 — forked from jfsiii/relativeLuminanceW3C.js
Calculate the relative luminance, or brightness, of a color. Accepts values 0-255 for R, G, B.
// from http://www.w3.org/TR/WCAG20/#relativeluminancedef
function relativeLuminanceW3C(R8bit, G8bit, B8bit) {
var RsRGB = R8bit/255;
var GsRGB = G8bit/255;
var BsRGB = B8bit/255;
var R = (RsRGB <= 0.03928) ? RsRGB/12.92 : Math.pow((RsRGB+0.055)/1.055, 2.4);
var G = (GsRGB <= 0.03928) ? GsRGB/12.92 : Math.pow((GsRGB+0.055)/1.055, 2.4);
var B = (BsRGB <= 0.03928) ? BsRGB/12.92 : Math.pow((BsRGB+0.055)/1.055, 2.4);
@krovma
krovma / Clang & MSVC VTable 对齐.md
Last active September 7, 2022 07:27
对比Clang与MSVC的对象模型实现

说明

运行环境

clang x86-64 12.0.0 -emit-llvm -Xclang -fdump-record-layouts -g -O0 MSVC 19.28.29337 for x64 /Od /d1reportAllClassLayout

vtable 均从汇编中截取,Clang 以 AT&T 语法表示,MSVC 以 Intel 语法表示。

以防万一的输出解释

@krovma
krovma / the-monster-license.txt
Last active August 6, 2026 16:24
The Monster License
"THE MONSTER LICENSE" (Rev. 11.45.14):
<krovma726@gmail.com> wrote this file. As long as you retain this notice you
can do whatever you want with this stuff. If we meet some day, and you think
this stuff is worth it, you can buy me a Monster Energy®[https://www.monsterenergy.com]
in return. Shitao "KZ" Zhou
Pirate from [https://en.wikipedia.org/wiki/Beerware]
------------------------------------------------------------
------------------------TRANSLATION-------------------------
------------------------------------------------------------
"MONSTER协议" (11.45.14版):