Skip to content

Instantly share code, notes, and snippets.

View xmonkee's full-sized avatar

Mayank Mandava xmonkee

View GitHub Profile
-- title: TIC-80 Speed test
-- author: Mayank Mandava, mayankmandava@gmail.com
-- desc:
-- site: website link
-- license: MIT License (change this to your license of choice)
-- version: 0.1
-- script: lua
music(0)
const testCases = [
['12 de julio de 2023', '2023-07-12'],
['11 de Julio de 2023.', '2023-07-11'],
['12/07/2023', '2023-07-12'],
['23 de mayo de 2023', '2023-05-23'],
['Domingo, 09 de julio de 2023', '2023-07-09'],
['29 de junio de 2023', '2023-06-29'],
['13 de julio de 2023', '2023-07-13'],
['09/06/2023', '2023-06-09'],
['27 de Abril de 2023', '2023-04-27'],
@xmonkee
xmonkee / vscode-theme.json
Created February 22, 2024 03:27
Default VSCode themes for Zed
{
"$schema": "https://zed.dev/schema/themes/v0.1.0.json",
"name": "Visual studio code themes",
"author": "Microsoft",
"themes":[
{
"name": "Light (Visual Studio)",
"appearance": "light",
"style": {
"border": null,
This file has been truncated, but you can view the full file.
{
"openapi": "3.0.0",
"info": {
"version": "1.1.0",
"title": "Zenduty",
"termsOfService": "https://zenduty.com",
"contact": {
"email": "vishwa@zenduty.com"
function getGroups(
allSuppliers: { id: string; score: number }[],
results: { left: string; right: string }[]
) {
const groups: Record<string, string> = {};
for (const { id } of allSuppliers) {
groups[id] = id;
}
const scoreMap: Record<string, number> = {};
for (const { id, score } of allSuppliers) {
@xmonkee
xmonkee / hash.test.js
Created April 1, 2026 22:34
Multiplicative scramble hash
const M = 1_295_827;
const N = 36 ** 4; // 1_679_616
// Extended Euclidean algorithm to find modular inverse
function modInverse(a, m) {
let [old_r, r] = [a, m];
let [old_s, s] = [1, 0];
while (r !== 0) {
const q = Math.floor(old_r / r);
[old_r, r] = [r, old_r - q * r];