Skip to content

Instantly share code, notes, and snippets.

@frankfenghua
frankfenghua / consoleColors.js
Created May 18, 2020 05:54 — forked from abritinthebay/consoleColors.js
The various escape codes you can use to color output to StdOut from Node JS
// Colors reference
// You can use the following as so:
// console.log(colorCode, data);
// console.log(`${colorCode}some colorful text string${resetCode} rest of string in normal color`);
//
// ... and so on.
export const reset = "\x1b[0m"
export const bright = "\x1b[1m"
export const dim = "\x1b[2m"
@frankfenghua
frankfenghua / gist:57cc5e56b86ba3ba8ccf42f3ead6828d
Created February 11, 2021 04:00 — forked from stuart11n/gist:9628955
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@frankfenghua
frankfenghua / wsl2.md
Created March 3, 2021 21:46 — forked from rfaita/wsl2.md
Installing WSL2 on Windows 10

Install and configure WSL2 on windows 10

Install WSL2

Using the following link here install the WSL 2 on your windows 10.

Install X-Server

VcXsrv seems to the best choice for X-Server in Windows

@frankfenghua
frankfenghua / update-git.sh
Created July 28, 2021 14:18 — forked from YuMS/update-git.sh
Update git to latest version on Ubuntu
#!/bin/bash
sudo add-apt-repository -y ppa:git-core/ppa
sudo apt-get update
sudo apt-get install git -y
@frankfenghua
frankfenghua / wsl2-network.ps1
Created September 12, 2021 05:33 — forked from daehahn/wsl2-network.ps1
WSL 2 TCP NETWORK FORWARDING
# WSL2 network port forwarding script v1
# for enable script, 'Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope CurrentUser' in Powershell,
# for delete exist rules and ports use 'delete' as parameter, for show ports use 'list' as parameter.
# written by Daehyuk Ahn, Aug-1-2020
# Display all portproxy information
If ($Args[0] -eq "list") {
netsh interface portproxy show v4tov4;
exit;
}
docker-compose rm --all && docker-compose build --no-cache