Skip to content

Instantly share code, notes, and snippets.

View b4lk0n's full-sized avatar

Andrii b4lk0n

  • @brilliantconsultingdev
  • Hungary
  • X @__b4lk0n
View GitHub Profile
import { err, isErr, ok } from "./result";
function createError<const T extends readonly string[]>(_codes: T) {
type Code = T[number];
class AppError<C extends Code = Code> extends Error {
public readonly code: C;
constructor(code: C) {
super(`Error: ${code}`);
import type { Thunk, UnaryFn } from "./func"
import { type Result, err, isErr, ok } from "./result"
export type AsyncResult<E, T> = Promise<Result<E, T>>
export const fromResult = <E, T>(result: Result<E, T>): AsyncResult<E, T> =>
Promise.resolve(result)
export const fromThrowable = async <E, T>(
f: Thunk<Promise<T>>,
@b4lk0n
b4lk0n / Remove all git tags
Created November 18, 2019 08:51 — forked from okunishinishi/Remove all git tags
Delete all git remote tags
#Delete local tags.
git tag -l | xargs git tag -d
#Fetch remote tags.
git fetch
#Delete remote tags.
git tag -l | xargs -n 1 git push --delete origin
#Delete local tasg.
git tag -l | xargs git tag -d
@b4lk0n
b4lk0n / update-submodules.sh
Last active February 21, 2017 12:51
Fetch submodules after checkout
# just because I always forget
git submodule update --init --recursive