I hereby claim:
- I am selimhex on github.
- I am selimhex (https://keybase.io/selimhex) on keybase.
- I have a public key ASAOFXE0LJB8XPLqrrEwd7dMHWu_JoYhdBE1v7w3bCP83wo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| /Users/YOU/Music/iTunes/iTunes Media/Music/ARTIST_FOLDER | |
| /Users/YOU/Music/iTunes/iTunes Media/Music/ANOTHER_ARTIST_FOLDER |
| # a primitive alias function to start a local php server | |
| # add this function to ~/.bash_profile and restart terminal | |
| # $ stphpserverhere or $ stp[tab] | |
| # no arguments starts the server at the current directory (pwd) | |
| # stphpserverhere 0 > starts the server at the default root | |
| # stphpserverhere ~/Documents/anotherDir starts the server at anotherDir. | |
| stphpserverhere() { | |
| serverroot=$(pwd) | |
| echo $serverroot |
| mkdir -p {Devrim,Dominique,Frank,Görkem,Henrik,Jens,Jürgen,Kevin,Rosanna,Selim} |
| # https://developers.google.com/speed/webp/faq#how_can_i_convert_my_personal_images_files_to_webp | |
| # convert all jpeg files in a directory | |
| for F in *.jpg; do cwebp $F -o `basename ${F%.jpg}`.webp; done | |
| # decode all webp files in a directory to png | |
| for F in *.webp; do dwebp $F -o `basename ${F%.webp}`.png; done |
| prettyJson = (obj) => { | |
| return JSON.stringify(obj, null, 2); | |
| }; | |
| log(obj, name = "", color = null, table = false) { | |
| if (table) { | |
| console.log(`%c${name}`, `color: ${color || "unset"}`); | |
| console.table(obj); | |
| return; | |
| } | |
| console.log(`%c${name}`, `color: ${color || "unset"}`, this.prettyJson(obj)); |
| # list all the processes and filter by "ssh" and kill the selected process | |
| ps -eo pid,command | grep ssh | fzf | awk '{print $1}' | xargs kill | |
| # search for the process and kill the selected process | |
| # use ' before keyword to search for the exact keyword (e.g. 'ssh) | |
| ps -eo pid,command | fzf | awk '{print $1}' | xargs kill |
| # rest is basically this one-liner with better fallbacks | |
| # open $(git remote -v | grep "push" | fzf | awk '{print $2}' | sed -e "s/^.*@//" -e "s/\:/\//" -e "s/\.git$//" | sed -e "s/^/https:\/\//") | |
| open_remote() { | |
| _formatSshUrlToHttp() { | |
| sshUrl="$1" | |
| url=$(echo $sshUrl | sed -e "s/^.*@//" -e "s/\:/\//" -e "s/\.git$//" -e "s/^/https:\/\//") | |
| echo $url | |
| } | |
| _remoteToUrl() { |