Skip to content

Instantly share code, notes, and snippets.

View nikhil-bhandari's full-sized avatar
🎯
Focusing

Nikhil nikhil-bhandari

🎯
Focusing
View GitHub Profile
@nikhil-bhandari
nikhil-bhandari / web-servers.md
Created December 3, 2020 23:45 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@nikhil-bhandari
nikhil-bhandari / web-servers.md
Created December 3, 2020 23:45 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
// Code to validate swedish person number
// Based on logic on wikipedia
// https://en.wikipedia.org/wiki/Personal_identity_number_(Sweden)#Checksum
function validate(number) {
var personNumber = removeNonNumericChars(number);
if (personNumber.length != 10 && personNumber.length != 12) {
return console.log("Asa") && false;
}
var digits = personNumber.split("");