This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local BASE_O = ("lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o lauxlib.o lbaselib.o lcorolib.o ldblib.o liolib.o lmathlib.o loadlib.o loslib.o lstrlib.o ltablib.o lutf8lib.o linit.o"):split(" ") | |
local LUA_AND_LUAC_O = ("lua.o luac.o"):split(" ") | |
local cc = "clang -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_3 -DLUA_BUILD_AS_DLL" | |
-- make .o | |
for _, object in pairs(BASE_O) do | |
local cFileName = object:sub(1, #object - 1) .. "c" | |
local command = cc .. " -c -o " .. object .. " " .. cFileName |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Better emojis | |
// @namespace Violentmonkey Scripts | |
// @match *://*/* | |
// @grant none | |
// @version 1.0 | |
// @run-at document-end | |
// @author - | |
// @description Replaces the default emoji font on your device. Works with newer browsers (Chrome & Edge 98+, Firefox 107+, Opera 100+) | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function findClosestBits(n) { | |
return BigInt('0b' + n.toString(2).replaceAll('0', '1')) | |
} | |
// Returns a uniform random value in [0, max) | |
function rand(max) { | |
if (max <= 0) throw new Error("Argument max must be > 0"); | |
if (max > 0xFFFFFFFFFFFFFFFFn) throw new Error("Argument max must be <= 0xFFFFFFFFFFFFFFFF"); | |
const randomNumber = new BigUint64Array(1); | |
crypto.getRandomValues(randomNumber); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <inttypes.h> | |
#include <string.h> | |
#include <immintrin.h> | |
#include <openssl/evp.h> | |
#include <openssl/err.h> | |
#include <openssl/kdf.h> | |
#include <openssl/rand.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <inttypes.h> | |
#include <string.h> | |
#include <openssl/evp.h> | |
#include <openssl/err.h> | |
#pragma comment (lib, "crypt32") | |
#pragma comment(lib, "ws2_32") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma comment (lib, "crypt32") | |
#pragma comment(lib, "ws2_32") | |
#pragma comment(lib, "user32") | |
#pragma comment(lib, "advapi32") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This is a "rewrite" of isaacCSPRNG by macmcmeans (https://github.com/macmcmeans/isaacCSPRNG) | |
It has been adapted to use newer JavaScript features. I've | |
removed some features that I deemed unnecessary, | |
but you can write them yourselves easily by using | |
the random() function as you would with Math.random(). | |
*/ | |
class isaacCSPRNG { | |
#memory; | |
#accumulator; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local function rol64(x, k) | |
return (x << k) | (x >> (64 - k)); | |
end | |
local function xoshiro256ss_step(state) | |
local result = rol64(state[2] * 5, 7) * 9; | |
local t = state[2] << 17; | |
state[3] = state[3] ~ state[1]; state[4] = state[4] ~ state[2]; state[2] = state[2] ~ state[3]; state[1] = state[1] ~ state[4]; | |
state[3] = state[3] ~ t; | |
state[4] = rol64(state[3], 45); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local function js_string_split(s, f) | |
local offset = 1 | |
local nextOffset = 0 | |
local result = {} | |
if not string.find(s, f) then | |
return { s } | |
end | |
if f == "" then | |
for i = 1, #s do | |
table.insert(result, s:sub(i, i)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function btoaUTF8(data) { | |
const utf8Data = new TextEncoder().encode(data); | |
let binaryString = ""; | |
for (let i = 0; i < utf8Data.length; i++) { | |
binaryString += String.fromCharCode(utf8Data[i]); | |
} | |
return btoa(binaryString); | |
} | |
function atobUTF8(data) { | |
const decodedData = atob(data); |
NewerOlder