Skip to content

Instantly share code, notes, and snippets.

View tonivj5's full-sized avatar
👨‍🎓
Studying...

Toni Villena tonivj5

👨‍🎓
Studying...
View GitHub Profile
@ioqy
ioqy / tutorial.md
Last active April 26, 2025 23:06
Free Let's Encrypt certificate without opening any ports

With this tutorial you will get a valid SSL certificate from Let's Encrypt without having to open any incoming ports. You can use the certificate to enable HTTPS with your reverse proxy (Apache, Nginx, Caddy, ...) or other self hosted service. Since it only uses acme.sh which is a shell script it should work on everything that runs linux.

The tutorial was written for and tested with Duck DNS and deSEC, but you can (in theory, because I did sadly encounter a few bugs/incompatibilities here and there) use every of the 150+ DNS provider supported by acme.sh (there is also a second page at the end!). If you want to use a wildcard certificate I would recommend deSEC because Duck DNS currently has a bug/incompatibility with acme.sh.

If you want to use another DNS provider you can skip right to 2. Install acme.sh, but need to change the parameter --dns YOURDNS in all the commands and set all necessary variables yourself according to t

@avallete
avallete / prisma-transactions-benchmark.ts
Created April 28, 2022 14:06
Prisma transactions benchmark 3.13.0
import { prisma } from "~/config/prisma";
async function executeWithoutTransaction(data: Array<{ name: string }>) {
return await Promise.all(
data.map((d) => prisma.projects.create({ data: d }))
);
}
async function executeWithArrayTransaction(data: Array<{ name: string }>) {
return await prisma.$transaction(
@conartist6
conartist6 / json-parser.js
Last active January 17, 2023 17:33
A human-friendly json parser with parserate
import parserate from '@iter-tools/parserate';
const t = {
token: (value) => ({ type: 'token', value }),
literal: (value) => ({ type: 'literal', value }),
};
const escapes = {
'"': '"',
'\\': '\\',
@dragomirtitian
dragomirtitian / findings.md
Last active November 27, 2023 22:39
`isolatedDeclarations` findings

A few findings from experimenting with isolated declarations:

New required type annotations

Exported variables

Exported variables will need an explicit type annotation (✅ implemented).

export const c1: 1 = 1; // ✔ ok, is explicit
@souporserious
souporserious / build.mjs
Created February 24, 2022 02:48
Build script using esbuild and ts-morph to bundle library code.
import glob from 'fast-glob'
import { build } from 'esbuild'
import { Project } from 'ts-morph'
const project = new Project({
compilerOptions: {
outDir: 'dist',
emitDeclarationOnly: true,
},
tsConfigFilePath: './tsconfig.json',
@jpzwarte
jpzwarte / poc.md
Last active July 30, 2022 02:03
PoC scoped custom element registries in Angular

PoC scoped custom element registries in Angular

  1. Render the AppComponent as a custom element
export class AppModule {
  ngDoBootstrap(): void {
    customElements.define('mg-root', createCustomIvyElement(AppComponent));
  }
}
@k-tten
k-tten / pipe.ts
Last active November 9, 2021 16:13
Arbitrary arity pipe function typings
type UnaryFunction<T, R> = (source: T) => R;
type Pipe<T, L = void, R extends UnaryFunction<any, any>[] = []> =
T extends []
? R
: L extends void
? T extends [(_: infer P) => infer V, ...infer Rest]
? Pipe<Rest, V, [...R, UnaryFunction<P, V>]>
: never[]
: T extends [(_: L) => infer V, ...infer Rest]
@zaripych
zaripych / typeFootprint.ts
Last active May 14, 2025 11:22
ts-morph type footprint
import {
Project,
Type,
Symbol,
SymbolFlags,
Signature,
Node,
TypeFormatFlags,
} from 'ts-morph';
@prrao87
prrao87 / install_postman_mint_no_snap.md
Last active June 3, 2025 08:21
Install Postman on Linux Mint (without using snap)

Goal

Postman is a usefull app to build and test APIs, most commonly installed on ubuntu-like systems via snap. On recent distributions of Linux Mint (20 and above), snap installs are no longer possible. The instructions below show how to install Postman via the terminal.

Download Postman

$ wget https://dl.pstmn.io/download/latest/linux64 -O postman.tar.gz

Extract archive

$ sudo tar -xzf postman.tar.gz -C /opt

Make symlink

@trungvose
trungvose / nx-structure-angular-nestjs.md
Last active May 5, 2025 05:13
Nx workspace structure for NestJS and Angular

Nx

https://nx.dev/

Nx is a suite of powerful, extensible dev tools to help you architect, test, and build at any scale — integrating seamlessly with modern technologies and libraries while providing a robust CLI, caching, dependency management, and more.

It has first-class support for many frontend and backend technologies, so its documentation comes in multiple flavours.

Principles