Instantly share code, notes, and snippets.

Pitt Pauly Pitt-Pauly

View GitHub Profile

Launch VSCode with the default Node version set - via Unity

So VSCode has an annoying bug that forces people to run nvm set before launching VSCode for it to recognise which node binary to use.

Since I am lazy I made a unity .desktop shortcut for it which launches a small script that does exactly that!

This could be extended in the future to include the option to use other Node versions too, and launching VSCode with them with the right click options.

I hope this saves people some time :)

View .bash_prompt
# Set the bash prompt according to:
# * the active virtualenv
# * the branch of the current git/mercurial repository
# * the return value of the previous command
# * the fact you just came from Windows and are used to having newlines in
# your prompts.
import re, string, timeit
s = "string. With. Punctuation"
exclude = set(string.punctuation)
table = string.maketrans("","")
regex = re.compile('[%s]' % re.escape(string.punctuation))
def test_set(s):
return ''.join(ch for ch in s if ch not in exclude)