Skip to content

Instantly share code, notes, and snippets.

@paul-vd
paul-vd / .aliases-private
Last active December 5, 2022 06:58
Aliases and configurations used in terminal
alias zdev="node ./z-dev/cli.js"
@paul-vd
paul-vd / .z-dev-cli.js
Last active May 19, 2022 11:44
z-dev cli
/* eslint-disable no-console */
const path = require("path");
const fs = require("fs");
const { promisify } = require("util");
const yargs = require("yargs");
const readdir = promisify(fs.readdir);
/**
* Look ma, it's cp -R.
* @param {string} source The path to the thing to copy.
@paul-vd
paul-vd / ordinateur.md
Last active September 25, 2022 17:29
Ordinateur
Article Prix du marché Mon prix de vente
MSI MPG X570 Gaming Pro AMD 329 200
2x 32gb 3200Mhz Vengeance LPX DDR4 246 100
Evga geforce rtx 2070 super 573 (rupture) 350
TOTAL: 1105 Euro 650 Euro
@paul-vd
paul-vd / git-diff-example.js
Last active March 18, 2022 21:44
git-diff
const ABORT_BUILD_CODE = 0;
const CONTINUE_BUILD_CODE = 1;
const continueBuild = () => {
console.log("🟢 - building");
process.exit(CONTINUE_BUILD_CODE);
};
const abortBuild = (reason) => {
console.log("⚪️ - build canceled :", reason);
process.exit(ABORT_BUILD_CODE);
@paul-vd
paul-vd / .aliases
Last active January 9, 2024 02:19
Aliases and configurations used in terminal
#!/bin/zsh
# Github
alias ga="git add -A"
alias gc="git commit -m"
alias gc!="git commit --amend"
alias gcundo!="git reset --soft HEAD@{1}" # undo last commit ammed: https://stackoverflow.com/a/1459264/7271467
alias gs="git switch -c"
alias gp="git remote prune origin" # prune tracking branches not on the remote.
alias pull="git pull"
@paul-vd
paul-vd / readme.md
Last active April 29, 2024 09:09
GPU Passthrough Fedora
@paul-vd
paul-vd / .bashrc || .zshrc
Last active December 19, 2021 18:29
Enables nvm to detect if there is an .nvmrc, if it finds it then it should switch the configured version
# enables nvm to detect if there is an .nvmrc, if it finds it,
# then it should switch the configured version:
# https://github.com/nvm-sh/nvm#nvmrc
cdnvm() {
cd "$@";
nvm_path=$(nvm_find_up .nvmrc | tr -d '\n')
# If there are no .nvmrc file, use the default nvm version
if [[ ! $nvm_path = *[^[:space:]]* ]]; then
@paul-vd
paul-vd / error-instance.tsx
Created June 29, 2021 14:50
Example Error Instances
'use strict'
// Here is the base error classes to extend from
export class ApplicationError extends Error {
get name() {
return this.constructor.name
}
}
@paul-vd
paul-vd / remove env file from git
Created January 18, 2021 21:36 — forked from gjerokrsteski/remove env file from git forever
remove env file from git history
echo '.env' >> .gitignore
git rm -r --cached .env
git add .gitignore
git commit -m 'untracking .env'
git push origin master