Skip to content

Instantly share code, notes, and snippets.

View sneas's full-sized avatar
🇺🇦

Dimah Snisarenko sneas

🇺🇦
View GitHub Profile
@sneas
sneas / index.ts
Last active November 19, 2025 07:39
TS Result type
// First, let's define the generic result type
type Success<T> = {
success: true;
value: T;
};
// Pay attention to the fact that
// Error is not a generic type
// we will use it for our advantage
type Error = {
@sneas
sneas / _checkbox.scss
Created November 27, 2020 08:56
Style checkbox element. CSS-only. No extra tags or classes required.
// Don't forget to enable autoprefixer.
// The escape-svg() function and checkmark SVG are taken from Bootstrap.
$escaped-characters: (
('<', '%3c'),
('>', '%3e'),
('#', '%23'),
('(', '%28'),
(')', '%29')
) !default;