This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
SITE_FOLDER=$1 | |
# creates the site folder | |
hugo new site $SITE_FOLDER | |
# install the latest avicenna theme | |
cd $SITE_FOLDER | |
git clone -b master git@github.com:hadisinaee/avicenna.git ./themes/avicenna |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Promise.all is good for executing many promises at once | |
Promise.all([ | |
promise1, | |
promise2 | |
]); | |
// Promise.resolve is good for wrapping synchronous code | |
Promise.resolve().then(function () { | |
if (somethingIsNotRight()) { | |
throw new Error("I will be rejected asynchronously!"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# declaring some colors for pretty output | |
declare -A colors=( ["g"]="\e[32m" ["r"]="\e[31m" ["y"]="\e[33m" ["b"]="\e[34m" ["m"]="\e[35m" ["c"]="\e[36m" ["default"]="\e[39m" ) | |
declare -A sets=( ["b"]="\e[1m" ["d"]="\e[2m" ["u"]="\e[4m" ["bl"]="\e[5m") | |
declare -A resets=( ["b"]="\e[21m" ["d"]="\e[22m" ["u"]="\e[24m" ["bl"]="\e[25m") | |
# declare colorful echo | |
function echoc { | |
STRING_PRIFIX='' | |
if [ -n "$2" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# git status, e.g: git st | |
git config --global alias.st status | |
# git status -s, e.g: git sts | |
git config --global alias.sts 'status -s' | |
# git commit, e.g: git ci | |
git config --global alias.ci commit | |
# git commit -m, e.g: git cim "" |