Skip to content

Instantly share code, notes, and snippets.

View TheLucifurry's full-sized avatar

Lucifurry TheLucifurry

View GitHub Profile
@ssalbdivad
ssalbdivad / ArkTypeVsZod.md
Last active November 3, 2025 02:03
ArkType/Zod Comparison

Here's a comparison between how the same simple user definition would be defined using ArkType and Zod:

image

ArkType's definition syntax is more concise (definitions are about 50% shorter on average) as well as making it more visually obvious what the inferred TypeScript type will be. The ability to infer TypeScript definitions directly is the same, but ArkType's syntax is again more concise by allowing you to use typeof on a property of arkUser directly instead of using an extra "infer" helper.

In general, we also have taken significant steps to optimize and clarify our type hints when hovering over validators. For example, in the case above, this is what you see when you mouse over "zodUser":

image

@sindresorhus
sindresorhus / esm-package.md
Last active December 5, 2025 20:00
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@maplemap
maplemap / pattern-memento.js
Created July 19, 2020 09:26 — forked from DmitriiNazimov/pattern-memento.js
[JS ES6 Паттерн ХРАНИТЕЛЬ (memento)] #js #ES6 #ООП #Паттерны
/**
*
* ПАТТЕРН ХРАНИТЕЛЬ (memento)
*
* Паттерн ХРАНИТЕЛЬ (memento) - Паттерн Хранитель используется для реализации возврата к одному из предыдущих
* состояний (например, если пользователь выполнил команду «Отменить»).
* Хранитель – это объект, в котором сохраняется внутреннее состояния другого объекта – хозяина хранителя. Для работы
* механизма отката нужно, чтобы хозяин предоставил хранитель, когда возникнет необходимость записать контрольную точку
* состояния хозяина. Только хозяину разрешено помещать в хранитель информацию и извлекать ее оттуда, для других
* объектов хранитель непрозрачен.
@cmod
cmod / hugofastsearch.md
Last active November 22, 2025 07:03 — forked from eddiewebb/readme.md
Fast, instant client side search for Hugo static site generator
@qoomon
qoomon / conventional-commits-cheatsheet.md
Last active December 6, 2025 12:31
Conventional Commits Cheatsheet
/* keep a reference to original toISOString to use it into new method */
const oldToISOString = Date.prototype.toISOString
/* Define new method */
const toISOString = function toISOString(date) {
if(!date) return date;
/* extract GTM timezone from date.toString() */
const regex = /(?:GMT)([-+]\d*)/gm;
let gtm = regex.exec(date.toString())[1];
gtm = [...gtm];
/* insert ':' in time -0500 -> -05:00*/
@jonathanlurie
jonathanlurie / jsont.js
Last active November 26, 2024 07:28
Serialize/deserialize json and conserve typed arrays
/*
Author: Jonathan Lurie - http://me.jonathanlurie.fr
License: MIT
The point of this little gist is to fix the issue of losing
typed arrays when calling the default JSON serilization.
The default mode has for effect to convert typed arrays into
object like that: {0: 0.1, 1: 0.2, 2: 0.3} what used to be
Float32Array([0.1, 0.2, 0.3]) and once it takes the shape of an
object, there is no way to get it back in an automated way!
@julien
julien / metaballs.glsl
Created October 29, 2016 12:24
simple metaball shader
precision highp float;
uniform float time;
uniform vec2 mouse;
uniform vec2 resolution;
float ball(vec2 p, float fx, float fy, float ax, float ay) {
vec2 r = vec2(p.x + sin(time * fx) * ax, p.y + cos(time * fy) * ay);
return 0.09 / length(r);
}
@rxaviers
rxaviers / gist:7360908
Last active December 7, 2025 02:13
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue: