Skip to content

Instantly share code, notes, and snippets.

View DarkAng3L's full-sized avatar
💭
🔨

Mihai DarkAng3L

💭
🔨
View GitHub Profile
@t3dotgg
t3dotgg / try-catch.ts
Last active August 21, 2026 08:53
Theo's preferred way of handling try/catch in TypeScript
// Types for the result object with discriminated union
type Success<T> = {
data: T;
error: null;
};
type Failure<E> = {
data: null;
error: E;
};
@t3dotgg
t3dotgg / model-prices.csv
Last active April 30, 2026 01:06
Rough list of popular AI models and the cost to use them (cost is per 1m tokens)
Name Input Output
Gemini 2.0 Flash-Lite $0.075 $0.30
Mistral 3.1 Small $0.10 $0.30
Gemini 2.0 Flash $0.10 $0.40
ChatGPT 4.1-nano $0.10 $0.40
DeepSeek v3 (old) $0.14 $0.28
ChatGPT 4o-mini $0.15 $0.60
Gemini 2.5 Flash $0.15 $0.60
DeepSeek v3 $0.27 $1.10
Grok 3-mini $0.30 $0.50
@DarkAng3L
DarkAng3L / CSS: Reset by Kevin Powell.css
Created April 16, 2024 10:18
CSS: Reset by Kevin Powell
/*
* Kevin Powell
* https://youtu.be/2lyDv0wOQuQ
* https://youtu.be/cCAtD_BAHNw
*/
*, *::before, *::after {
box-sizing: border-box; /* Switch to border-box for box-sizing. */
}
@palashmon
palashmon / Prettify.ts
Created May 13, 2023 16:11
A super useful type helper in TypeScript by Matt Pocock from Twitter
/**
* A TypeScript type alias called `Prettify`.
* It takes a type as its argument and returns a new type that has the same properties as the original type,
* but the properties are not intersected. This means that the new type is easier to read and understand.
*/
type Prettify<T> = {
[K in keyof T]: T[K];
} & {};
@wojteklu
wojteklu / clean_code.md
Last active August 30, 2026 12:22
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules