only changed files:
git add -u
only changed and new (but not deleted)
git add .
changed, new, and deleted
git add -A
# http://webapps.stackexchange.com/questions/39587/view-estimated-size-of-github-repository-before-cloning | |
# tested on macOS | |
echo https://github.com/torvalds/linux.git | perl -ne 'print $1 if m!([^/]+/[^/]+?)(?:\.git)?$!' | xargs -I{} curl -s -k https://api.github.com/repos/'{}' | grep size | |
# output: | |
# "size": 1746294, |
/* | |
In JavaScript, objects can be used to serve various purposes. | |
To maximise our usage of the type system, we should assign different types to our objects depending | |
on the desired purpose. | |
In this blog post I will clarify two common purposes for objects known as records and dictionaries | |
(aka maps), and how they can both be used with regards to the type system. |
# Mailhog | |
MAIL_MAILER=smtp | |
MAIL_HOST=0.0.0.0 | |
MAIL_PORT=1025 | |
MAIL_USERNAME=null | |
MAIL_PASSWORD=null | |
MAIL_ENCRYPTION=null |
Let suppose I have two github accounts, https://github.com/rahul-office and https://github.com/rahul-personal. Now i want to setup my mac to easily talk to both the github accounts.
NOTE: This logic can be extended to more than two accounts also. :)
The setup can be done in 5 easy steps:
function hash(string) { | |
const utf8 = new TextEncoder().encode(string); | |
return crypto.subtle.digest('SHA-256', utf8).then((hashBuffer) => { | |
const hashArray = Array.from(new Uint8Array(hashBuffer)); | |
const hashHex = hashArray | |
.map((bytes) => bytes.toString(16).padStart(2, '0')) | |
.join(''); | |
return hashHex; | |
}); | |
} |