Skip to content

Instantly share code, notes, and snippets.

View aledpardo's full-sized avatar
🏠
Working from home

Alexandre Pardo aledpardo

🏠
Working from home
View GitHub Profile
@aledpardo
aledpardo / typescript-union-types-with-function-overloading.md
Last active February 7, 2023 14:55
Using Typescript union types effectively

Using Typescript union types effectively

A hypothetical REST API

Suppose a REST API with the following request patterns:

Correct usage:

GET /books/?authors=JRRTolkien,CSLewis
200 OK
@aledpardo
aledpardo / angular-build-with-esbuild-analysis.md
Last active February 10, 2022 23:36
Angular CLI build outputs comparison - original vs with esbuild

Introduction

This is a simple analysis to compare the performances in compilation time and bundle size between the original Angular build setup and esbuild.

Building default Angular 13 app with original build setup

First run

$ npm run build
@aledpardo
aledpardo / javascript-concepts.md
Last active July 21, 2021 23:56
JavaScript Concepts

JavaScript

Data Types

Primitive Types

Primitive types are the basic types. One important fact is that variables of these types are passed by value to functions.

var number = 10
@aledpardo
aledpardo / solution.md
Last active December 31, 2021 05:00
Fix internet connection in WSL2 when using Cisco AnyConnect VPN
@aledpardo
aledpardo / how-to-use-git-rebase.md
Last active January 28, 2023 00:06
How to use GIT Rebase

How to use GIT rebase

When need to have a more concise git history of changes.

TL;DR;

To rebase your local branch commits into 1:

git rebase -i HEAD~# number of commits
@aledpardo
aledpardo / how-to.sh
Created September 15, 2020 20:20
Docker Images - How to build, save, tag and push to a registry
docker build -f Dockerfile -t <image-name> .
docker save <image-name> > docker/<image-name>.tar
docker images
docker tag <image-name>:<tag> <repo-root>/<image-name>:<tag>
docker push <repo-root>/<image-name>:<tag>
docker login
docker push <repo-root>/<image-name>:<tag>
From:
https://dev.to/maxwell_dev/the-git-rebase-introduction-i-wish-id-had
Simple flow
git checkout master
git checkout feature/branch
git rebase master
git push --force-with-lease
#Mount an SMB file share with rw+ permissions
mount_smbfs -d 777 -f 777 //Alexandre@CENTAURO/BACKUP_MAC BACKUP_MAC
#Synchronize files between directories
rsync -vaEt --progress ~/Documents ~/BACKUP_MAC/Documents/
#Unmount an SMB file share
umount BACKUP_MAC
#See how much disk is being used/free
@aledpardo
aledpardo / Find replace regex.txt
Last active November 29, 2015 19:27
Regex useful for mapping properties
find: (public)([\s]*[\S]+\ )([\S]+[\s]*[\S]+) ({ get; set; })
replace: $3 = model.$3,
@aledpardo
aledpardo / useful websites
Last active September 28, 2015 03:20
List of useful websites
Javascript Char Codes to Key Codes: http://www.cambiaresearch.com/articles/15/javascript-char-codes-key-codes
Spliting CSV values with regular expression: http://www.schiffhauer.com/c-split-csv-values-with-a-regular-expression/