@sebastienrousseau/dotfiles 0.2.440 → 0.2.453

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (156) hide show
  1. package/COPYRIGHT +5 -0
  2. package/LICENSE +1260 -2
  3. package/Makefile +79 -0
  4. package/README.md +390 -70
  5. package/bin/dotfiles.sh +157 -0
  6. package/index.js +24 -0
  7. package/package.json +99 -25
  8. package/pnpm-lock.yaml +232 -0
  9. package/pnpm-workspace.yaml +2 -0
  10. package/shell/README.md +3 -0
  11. package/{Icon/r → shell/aliases/default/README.md} +0 -0
  12. package/shell/aliases/default/default.aliases.sh +199 -0
  13. package/shell/aliases/gcloud/gcloud.aliases.sh +121 -0
  14. package/shell/aliases/git/git.aliases.wip +586 -0
  15. package/shell/aliases/heroku/heroku.aliases.sh +1031 -0
  16. package/shell/aliases/jekyll/jekyll.aliases.sh +50 -0
  17. package/shell/aliases/pnpm/pnpm.aliases.sh +42 -0
  18. package/shell/aliases/subversion/subversion.aliases.sh +123 -0
  19. package/shell/aliases/tmux/tmux.aliases.sh +14 -0
  20. package/shell/aliases.sh +12 -0
  21. package/shell/configurations/README.md +3 -0
  22. package/shell/configurations/bash/bashrc +36 -0
  23. package/shell/configurations/curl/cacert.pem +3460 -0
  24. package/shell/configurations/curl/curlrc +55 -0
  25. package/shell/configurations/default/color.sh +17 -0
  26. package/shell/configurations/default/editor.sh +16 -0
  27. package/shell/configurations/default/prompt.sh +37 -0
  28. package/shell/configurations/inputrc/inputrc +22 -0
  29. package/shell/configurations/jshint/jshintrc +37 -0
  30. package/shell/configurations/profile/profile +36 -0
  31. package/shell/configurations/tmux/tmux +95 -0
  32. package/shell/configurations/vim/vimrc +73 -0
  33. package/{.wgetrc → shell/configurations/wget/wgetrc} +4 -0
  34. package/shell/configurations/zsh/zshrc +50 -0
  35. package/shell/configurations.sh +10 -0
  36. package/shell/exit.sh +9 -0
  37. package/shell/functions/README.md +3 -0
  38. package/shell/functions/cdls.sh +19 -0
  39. package/shell/functions/changediskpwd.wip +19 -0
  40. package/shell/functions/code.wip +18 -0
  41. package/shell/functions/countdown.wip +33 -0
  42. package/shell/functions/curlheader.sh +20 -0
  43. package/shell/functions/curltime.sh +31 -0
  44. package/shell/functions/encode64.sh +25 -0
  45. package/shell/functions/environment.sh +37 -0
  46. package/shell/functions/extract.sh +32 -0
  47. package/shell/functions/filehead.sh +4 -0
  48. package/{zsh/zsh/functions/genpwd.zsh → shell/functions/genpwd.sh} +8 -3
  49. package/shell/functions/goto.sh +14 -0
  50. package/shell/functions/headers.wip +4 -0
  51. package/{zsh/zsh/functions/hidehiddenfiles.zsh → shell/functions/hidehiddenfiles.sh} +7 -2
  52. package/shell/functions/history-all.wip +7 -0
  53. package/shell/functions/hostinfo.sh +25 -0
  54. package/{zsh/zsh/functions/hstats.zsh → shell/functions/hstats.sh} +6 -1
  55. package/shell/functions/httpdebug.sh +7 -0
  56. package/shell/functions/keygen.sh +23 -0
  57. package/shell/functions/last.sh +9 -0
  58. package/shell/functions/logout.sh +10 -0
  59. package/shell/functions/lowercase.sh +28 -0
  60. package/shell/functions/macos.sh +47 -0
  61. package/shell/functions/matrix.sh +9 -0
  62. package/shell/functions/mcd.sh +18 -0
  63. package/shell/functions/mount_read_only.sh +9 -0
  64. package/shell/functions/myproc.sh +7 -0
  65. package/shell/functions/prependpath.sh +19 -0
  66. package/shell/functions/print.wip +13 -0
  67. package/shell/functions/ql.sh +7 -0
  68. package/shell/functions/rd.sh +15 -0
  69. package/shell/functions/remove_disk.sh +9 -0
  70. package/shell/functions/ren.sh +11 -0
  71. package/shell/functions/rm.wip +13 -0
  72. package/shell/functions/rps.wip +103 -0
  73. package/{zsh/zsh/functions/showhiddenfiles.zsh → shell/functions/showhiddenfiles.sh} +7 -2
  74. package/{zsh/zsh/functions/size.zsh → shell/functions/size.sh} +6 -1
  75. package/shell/functions/stopwatch.sh +13 -0
  76. package/shell/functions/trash.wip +13 -0
  77. package/shell/functions/tree.wip +13 -0
  78. package/shell/functions/uppercase.sh +28 -0
  79. package/shell/functions/uuidgen.wip +27 -0
  80. package/shell/functions/view-source.sh +8 -0
  81. package/shell/functions/vscode.sh +31 -0
  82. package/shell/functions/whoisport.sh +12 -0
  83. package/shell/functions/zipf.sh +14 -0
  84. package/shell/functions.sh +10 -0
  85. package/shell/history.sh +107 -0
  86. package/shell/paths/ant/ant.paths.sh +15 -0
  87. package/shell/paths/default/default.paths.sh +17 -0
  88. package/shell/paths/homebrew/homebrew.paths.sh +25 -0
  89. package/shell/paths/java/java.paths.sh +16 -0
  90. package/shell/paths/maven/maven.paths.sh +17 -0
  91. package/shell/paths/node/node.paths.sh +13 -0
  92. package/shell/paths/nvm/nvm.paths.sh +21 -0
  93. package/shell/paths/pnpm/pnpm.paths.sh +13 -0
  94. package/shell/paths/python/python.paths.sh +19 -0
  95. package/shell/paths/ruby/ruby.paths.sh +23 -0
  96. package/shell/paths/tmux/tmux.paths.sh +14 -0
  97. package/shell/paths.sh +12 -0
  98. package/.curlrc +0 -17
  99. package/.eslintrc +0 -44
  100. package/.jshintrc +0 -22
  101. package/.travis.yml +0 -21
  102. package/CODE_OF_CONDUCT.md +0 -46
  103. package/CONTRIBUTING.md +0 -60
  104. package/Dotfiles.png +0 -0
  105. package/ISSUE_TEMPLATE.md +0 -43
  106. package/bash/.bash_aliases +0 -409
  107. package/bash/.bash_exit +0 -25
  108. package/bash/.bash_functions +0 -312
  109. package/bash/.bash_load_completion +0 -62
  110. package/bash/.bash_profile +0 -295
  111. package/bash/.bashrc +0 -47
  112. package/homebrew/brew-cask.sh +0 -165
  113. package/homebrew/brew-package.sh +0 -256
  114. package/homebrew/brew-tap.sh +0 -35
  115. package/homebrew/install.sh +0 -29
  116. package/zsh/.zshrc +0 -64
  117. package/zsh/aliases.zsh +0 -427
  118. package/zsh/configurations.zsh +0 -19
  119. package/zsh/exit.zsh +0 -21
  120. package/zsh/functions.zsh +0 -42
  121. package/zsh/history.zsh +0 -53
  122. package/zsh/profile.zsh +0 -17
  123. package/zsh/zsh/configurations/color.zsh +0 -21
  124. package/zsh/zsh/configurations/editor.zsh +0 -21
  125. package/zsh/zsh/configurations/history.zsh +0 -53
  126. package/zsh/zsh/configurations/path.zsh +0 -123
  127. package/zsh/zsh/configurations/prompt.zsh +0 -24
  128. package/zsh/zsh/functions/cd.zsh +0 -51
  129. package/zsh/zsh/functions/cdls.zsh +0 -11
  130. package/zsh/zsh/functions/changediskpwd.zsh +0 -4
  131. package/zsh/zsh/functions/code.zsh +0 -2
  132. package/zsh/zsh/functions/countdown.zsh +0 -33
  133. package/zsh/zsh/functions/curlheader.zsh +0 -12
  134. package/zsh/zsh/functions/curltime.zsh +0 -12
  135. package/zsh/zsh/functions/extract.zsh +0 -27
  136. package/zsh/zsh/functions/goto.zsh +0 -8
  137. package/zsh/zsh/functions/history-all.zsh +0 -2
  138. package/zsh/zsh/functions/hostinfo.zsh +0 -19
  139. package/zsh/zsh/functions/httpdebug.zsh +0 -2
  140. package/zsh/zsh/functions/keygen.zsh +0 -18
  141. package/zsh/zsh/functions/logout.zsh +0 -5
  142. package/zsh/zsh/functions/lowercase.zsh +0 -23
  143. package/zsh/zsh/functions/matrix.zsh +0 -4
  144. package/zsh/zsh/functions/mcd.zsh +0 -11
  145. package/zsh/zsh/functions/mount_read_only.zsh +0 -4
  146. package/zsh/zsh/functions/myproc.zsh +0 -2
  147. package/zsh/zsh/functions/print.zsh +0 -8
  148. package/zsh/zsh/functions/ql.zsh +0 -2
  149. package/zsh/zsh/functions/rd.zsh +0 -8
  150. package/zsh/zsh/functions/remove_disk.zsh +0 -4
  151. package/zsh/zsh/functions/rm.zsh +0 -10
  152. package/zsh/zsh/functions/stopwatch.zsh +0 -8
  153. package/zsh/zsh/functions/trash.zsh +0 -8
  154. package/zsh/zsh/functions/tree.zsh +0 -8
  155. package/zsh/zsh/functions/uppercase.zsh +0 -23
  156. package/zsh/zsh/functions/zipf.zsh +0 -9
@@ -0,0 +1,37 @@
1
+ #!/usr/bin/env bash
2
+ # 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.453) - https://dotfiles.io
3
+ # Copyright (c) Sebastien Rousseau 2022. All rights reserved
4
+ # License: MIT
5
+
6
+ # environment: Function to detect the current environment
7
+ environment ()
8
+ {
9
+ # Define a fallback `OS`
10
+ LOCAL_OS="other"
11
+
12
+ # Mac
13
+ if [[ "$(uname -s | grep -c Darwin)" -gt 0 ]] || true; then
14
+ LOCAL_OS="mac"
15
+
16
+ # Linux
17
+ elif [[ "$(uname -s | grep -c Linux)" -gt 0 ]] || true; then
18
+ LOCAL_OS="linux"
19
+
20
+ # Windows via MING
21
+ elif [[ "$(uname -s | grep -c MING)" -gt 0 ]] || true; then
22
+ LOCAL_OS="win"
23
+
24
+ # Cygwin
25
+ elif [[ "$(uname -s | grep -c Cygwin)" -gt 0 ]] || true; then
26
+ LOCAL_OS="win"
27
+
28
+ # Cygwin via Babun
29
+ elif [[ "$(uname -s | grep -c CYGWIN)" -gt 0 ]] || true; then
30
+ LOCAL_OS="win"
31
+
32
+ fi
33
+
34
+ # Output the result
35
+ echo "${LOCAL_OS}"
36
+
37
+ }
@@ -0,0 +1,32 @@
1
+ #!/usr/bin/env bash
2
+ # 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.453) - https://dotfiles.io
3
+ # Copyright (c) Sebastien Rousseau 2022. All rights reserved
4
+ # License: MIT
5
+
6
+ # extract: Function to extract most know archives with one command
7
+ extract() {
8
+ if [[ "$#" != 1 ]]; then
9
+ echo "[ERROR] Please add one argument" >&2
10
+ return 1
11
+ fi
12
+
13
+ if [[ -f "$1" ]]; then
14
+ echo "[INFO] Extracting $1"
15
+ case $1 in
16
+ *.tar.bz2) tar xjf "$1" ;;
17
+ *.tar.gz) tar xzf "$1" ;;
18
+ *.bz2) bunzip2 "$1" ;;
19
+ *.rar) unrar e "$1" ;;
20
+ *.gz) gunzip "$1" ;;
21
+ *.tar) tar xf "$1" ;;
22
+ *.tbz2) tar xjf "$1" ;;
23
+ *.tgz) tar xzf "$1" ;;
24
+ *.zip) unzip "$1" ;;
25
+ *.Z) uncompress "$1" ;;
26
+ *.7z) 7z x "$1" ;;
27
+ *) echo "[ERROR] '$1' cannot be extracted via extract()" ;;
28
+ esac
29
+ else
30
+ echo "[ERROR] '$1' is not a valid file"
31
+ fi
32
+ }
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # filehead: Function to display the first lines of a file.
4
+ filehead () { /usr/bin/xxd -u -g 1 "$@" | /usr/bin/head ;}
@@ -1,9 +1,14 @@
1
+ #!/usr/bin/env bash
2
+ # 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.453) - https://dotfiles.io
3
+ # Copyright (c) Sebastien Rousseau 2022. All rights reserved
4
+ # License: MIT
5
+
1
6
  # genpwd: Function to generates a strong random password of 20 characters (similar to Apple)
2
- function genpwd() {
7
+ genpwd() {
3
8
  m=$(openssl rand -base64 32 | cut -c 1-6);
4
9
  a=$(openssl rand -base64 32 | cut -c 1-6);
5
10
  c=$(openssl rand -base64 32 | cut -c 1-6);
6
- pwd="$m-$a-$c";
11
+ pwd="$m-$a-$c";
7
12
  echo "[INFO] The password has been copied to the clipboard: $pwd"
8
- echo "$pwd"| pbcopy | pbpaste;
13
+ echo "$pwd"| pbcopy | pbpaste;
9
14
  }
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env bash
2
+ # 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.453) - https://dotfiles.io
3
+ # Copyright (c) Sebastien Rousseau 2022. All rights reserved
4
+ # License: MIT
5
+
6
+ # goto: Function to change to the directory inputed
7
+ goto() {
8
+ if [[ -e "$1" ]]; then
9
+ cd "$1" || exit
10
+ l
11
+ else
12
+ echo "[ERROR] Please add a directory name" >&2
13
+ fi
14
+ }
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # headers: Function to retrieve the headers of the request.
4
+ #headers() { /usr/bin/curl -X GET -I -L -k -A 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36' $@ }
@@ -1,7 +1,12 @@
1
+ #!/usr/bin/env bash
2
+ # 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.453) - https://dotfiles.io
3
+ # Copyright (c) Sebastien Rousseau 2022. All rights reserved
4
+ # License: MIT
5
+
1
6
  # Hide hidden system and dotfile files
2
- function hidehiddenfiles() {
7
+ hidehiddenfiles() {
3
8
  defaults write com.apple.Finder AppleShowAllFiles NO
4
9
  osascript -e 'tell application "Finder" to quit'
5
10
  sleep 0.25
6
11
  osascript -e 'tell application "Finder" to activate'
7
- }
12
+ }
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env bash
2
+ # 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.453) - https://dotfiles.io
3
+ # Copyright (c) Sebastien Rousseau 2022. All rights reserved
4
+ # License: MIT
5
+
6
+ # history-all: Function to display the full view of the history command
7
+ #function history-all { history -E 1 }
@@ -0,0 +1,25 @@
1
+ #!/usr/bin/env bash
2
+ # 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.453) - https://dotfiles.io
3
+ # Copyright (c) Sebastien Rousseau 2022. All rights reserved
4
+ # License: MIT
5
+
6
+ # hostinfo: Function to display useful host related informaton
7
+ hostinfo() {
8
+ echo "You are logged on"
9
+ $HOST
10
+ echo "Additionnal information: "
11
+ uname -a
12
+ echo "Users logged on: "
13
+ w -h
14
+ echo "Current date : "
15
+ date
16
+ echo "Machine stats : "
17
+ uptime
18
+ echo "Current network location : "
19
+ scselect
20
+ echo "Public facing IP Address : "
21
+ myip
22
+ echo "DNS Configuration: "
23
+ scutil --dns
24
+ echo
25
+ }
@@ -1,4 +1,9 @@
1
+ #!/usr/bin/env bash
2
+ # 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.453) - https://dotfiles.io
3
+ # Copyright (c) Sebastien Rousseau 2022. All rights reserved
4
+ # License: MIT
5
+
1
6
  # hstats: Function to display Ze Shell history stats informaton
2
- function hstats() {
7
+ hstats() {
3
8
  history | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n20
4
9
  }
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env bash
2
+ # 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.453) - https://dotfiles.io
3
+ # Copyright (c) Sebastien Rousseau 2022. All rights reserved
4
+ # License: MIT
5
+
6
+ # httpdebug: Function to download a web page and show info on what took time
7
+ httpdebug() { /usr/bin/curl "$@" -o /dev/null -w "dns: %{time_namelookup} connect: %{time_connect} pretransfer: %{time_pretransfer} starttransfer: %{time_starttransfer} total: %{time_total}\\n"; }
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env bash
2
+ # 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.453) - https://dotfiles.io
3
+ # Copyright (c) Sebastien Rousseau 2022. All rights reserved
4
+ # License: MIT
5
+
6
+ # keygen: Function to generates SSH key
7
+ keygen() {
8
+
9
+ echo "What's the name of the Key (no space please) ? "
10
+ read -r name
11
+
12
+ echo "What's the email associated with it? "
13
+ read -r email
14
+
15
+ ssh-keygen -t rsa -f ~/.ssh/id_rsa_"${name}" -C "${email}"
16
+
17
+ ssh-add ~/.ssh/id_rsa_"${name}"
18
+
19
+ pbcopy <~/.ssh/id_rsa_"${name}".pub
20
+
21
+ echo "[INFO] SSH Key id_rsa_$(name).pub copied in your clipboard"
22
+
23
+ }
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env bash
2
+ # 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.453) - https://dotfiles.io
3
+ # Copyright (c) Sebastien Rousseau 2022. All rights reserved
4
+ # License: MIT
5
+
6
+ # last: List the modified files within 60 minutes.
7
+ last() {
8
+ find . -type f -mmin -60
9
+ }
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env bash
2
+ # 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.453) - https://dotfiles.io
3
+ # Copyright (c) Sebastien Rousseau 2022. All rights reserved
4
+ # License: MIT
5
+
6
+ # logout: Function to logout from OS X via the Terminal
7
+ logout() {
8
+ osascript -e 'tell application "System Events" to log out'
9
+ builtin logout
10
+ }
@@ -0,0 +1,28 @@
1
+ #!/usr/bin/env bash
2
+ # 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.453) - https://dotfiles.io
3
+ # Copyright (c) Sebastien Rousseau 2022. All rights reserved
4
+ # License: MIT
5
+
6
+ # lowercase: Function to move filenames or directory names to lowercase
7
+ lowercase()
8
+ {
9
+ if [[ "$#" != 1 ]]; then
10
+ echo "[ERROR] The filename or directory name is incorrect." >&2
11
+ return 1
12
+ fi
13
+ for file ; do
14
+ filename=${file##*/}
15
+ case "${filename}" in
16
+ */*) [[ "dirname" = "${file%/*}" ]] ;;
17
+ *) dirname=.;;
18
+ esac
19
+ nf=$(echo "${filename}" | tr '[:upper:]' '[:lower:]')
20
+ newname="${dirname}/${nf}"
21
+ if [[ "${nf}" != "${filename}" ]]; then
22
+ mv "${file}" "${newname}"
23
+ echo "[INFO] Renaming ${file} to lowercase: ${newname}"
24
+ else
25
+ echo "[ERROR] The operation is not valid, ${file} has not changed."
26
+ fi
27
+ done
28
+ }
@@ -0,0 +1,47 @@
1
+ #!/usr/bin/env bash
2
+ # 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.453) - https://dotfiles.io
3
+ # Copyright (c) Sebastien Rousseau 2022. All rights reserved
4
+ # License: MIT
5
+
6
+ # 🅼🅰🅲🅾🆂 🅿🅻🆄🅶🅸🅽🅶 🅰🅻🅸🅰🆂🅴🆂
7
+
8
+ alias clds='find . -type f -name "*.DS_Store" -ls -delete' # clds: Recursively delete .DS_Store files.
9
+ alias clls='/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user && killall Finder' # clls: Clean up LaunchServices to remove duplicates in the 'Open With' menu.
10
+ alias emptytrash='rm -rf ~/.Trash/*' # Empty the Trash on all mounted volumes and the main HDD.
11
+ alias finderHideHidden='defaults write com.apple.finder ShowAllFiles FALSE' # finderHideHidden: Hide hidden files in Finder.
12
+ alias finderShowHidden='defaults write com.apple.finder ShowAllFiles TRUE' # finderShowHidden: Show hidden files in Finder.
13
+ alias iphone='open /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app' # iphone: Open the device simulators.
14
+ alias noDS='defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true'
15
+ alias ofd='open $PWD' # Open the current directory in a Finder window.
16
+ alias purge='rm -rf ~/library/Developer/Xcode/DerivedData/*' # purge: Purging Xcode DerivedData.
17
+ alias screensaverDesktop='/System/Library/Frameworks/ScreenSaver.framework/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine -background' # screensaverDesktop: Run a screensaver on the Desktop.
18
+ alias vp='diskutil verifyPermissions /' # vp: Verify macOS Permissions.
19
+ alias vv='diskutil verifyvolume /' # vv: Verify macOS Volume.
20
+ alias xcode='open -a xcode' # xcode: Launch XCode app in macOS.
21
+
22
+ # 🅼🅰🅲🅾🆂 🅿🅻🆄🅶🅸🅽🅶 🅵🆄🅽🅲🆃🅸🅾🅽🆂
23
+
24
+ # Erases purgeable disk space with 0s on the selected disk
25
+ freespace(){
26
+ if [[ -z "$1" ]]; then
27
+ echo "Usage: $0 <disk>"
28
+ echo "Example: $0 /dev/disk1s1"
29
+ echo
30
+ echo "Possible disks:"
31
+ df -h | awk 'NR == 1 || /^\/dev\/disk/'
32
+ return 1
33
+ fi
34
+
35
+ echo "Cleaning purgeable files from disk: $1 ...."
36
+ diskutil secureErase freespace 0 "$1"
37
+ }
38
+
39
+ mp() {
40
+ # Don't let Preview.app steal focus if the man page doesn't exist
41
+ man -w "$@" > /dev/null 2>&1 || man -t "$@" | open -f -a Preview || man "$@"
42
+ }
43
+
44
+ ql() {
45
+ (( $# > 0 )) && qlmanage -p "$*" &>/dev/null &
46
+ }
47
+
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env bash
2
+ # 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.453) - https://dotfiles.io
3
+ # Copyright (c) Sebastien Rousseau 2022. All rights reserved
4
+ # License: MIT
5
+
6
+ # matrix: Function to Enable Matrix Effect in the terminal
7
+ matrix() {
8
+ echo -e "\\e[1;40m" ; clear ; while :; do echo $LINES $COLUMNS $(( RANDOM % COLUMNS)) $(( RANDOM % 72 )) ;sleep 0.05; done|awk '{ letters="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#$%^&*()"; c=$4; letter=substr(letters,c,1);a[$3]=0;for (x in a) {o=a[x];a[x]=a[x]+1; printf "\033[%s;%sH\033[2;32m%s",o,x,letter; printf "\033[%s;%sH\033[1;37m%s\033[0;0H",a[x],x,letter;if (a[x] >= $1) { a[x]=0; } }}'
9
+ }
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env bash
2
+ # 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.453) - https://dotfiles.io
3
+ # Copyright (c) Sebastien Rousseau 2022. All rights reserved
4
+ # License: MIT
5
+
6
+ # mcd: Function to combine mkdir and cd.
7
+ mcd() {
8
+ if [[ "$#" != 1 ]]; then
9
+ echo "[ERROR] Please add one argument" >&2
10
+ return 1
11
+ fi
12
+ echo "[INFO] Creating the folder $1"
13
+ mkdir "$1"
14
+ echo "[INFO] Switching to $1 folder"
15
+ cd "$1" || exit
16
+ }
17
+
18
+ alias mkcd='mcd' # Alias for mcd
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env bash
2
+ # 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.453) - https://dotfiles.io
3
+ # Copyright (c) Sebastien Rousseau 2022. All rights reserved
4
+ # License: MIT
5
+
6
+ # mount_read_only: Function to mount a read-only disk image as read-write
7
+ mount_read_only() {
8
+ hdiutil attach "$1" -shadow /tmp/"$1".shadow -noverify
9
+ }
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env bash
2
+ # 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.453) - https://dotfiles.io
3
+ # Copyright (c) Sebastien Rousseau 2022. All rights reserved
4
+ # License: MIT
5
+
6
+ # myproc: Function to list processes owned by an user
7
+ myproc() { ps "$@" -u "${USER}" -o pid,%cpu,%mem,start,time,bsdtime,command; }
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/env bash
2
+ # 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.453) - https://dotfiles.io
3
+ # Copyright (c) Sebastien Rousseau 2022. All rights reserved
4
+ # License: MIT
5
+
6
+ # ----------------------------------------------------------------------------
7
+ # 1.0 Setting PATH environments.
8
+ # ----------------------------------------------------------------------------
9
+
10
+ ## ----------------------------------------------------------------------------
11
+ ## 1.1 Prepend $PATH without duplicates.
12
+ ## ----------------------------------------------------------------------------
13
+
14
+ # prependpath: Prepend $PATH without duplicates
15
+ prependpath() {
16
+ if ! echo "${PATH}" | tr ":" "\n" | grep -qx "$1" ; then
17
+ PATH="$1:${PATH}"
18
+ fi
19
+ }
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env bash
2
+ # 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.453) - https://dotfiles.io
3
+ # Copyright (c) Sebastien Rousseau 2022. All rights reserved
4
+ # License: MIT
5
+
6
+ # print: Function to display the argument given
7
+ # print() {
8
+ # if [[ "$#" != 1 ]]; then
9
+ # echo "[ERROR] Please add one argument" >&2
10
+ # return 1
11
+ # fi
12
+ # echo "$1"
13
+ # }
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env bash
2
+ # 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.453) - https://dotfiles.io
3
+ # Copyright (c) Sebastien Rousseau 2022. All rights reserved
4
+ # License: MIT
5
+
6
+ # ql: Function to open any file in MacOS Quicklook Preview
7
+ ql() { qlmanage -p "$*" >&/dev/null; }
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env bash
2
+ # 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.453) - https://dotfiles.io
3
+ # Copyright (c) Sebastien Rousseau 2022. All rights reserved
4
+ # License: MIT
5
+
6
+ # rd: Function to remove a directory and its files
7
+ rd() {
8
+ if [[ "$#" != 1 ]]; then
9
+ echo "[ERROR] Please add one argument" >&2
10
+ return 1
11
+ fi
12
+ echo "[INFO] The operation completed successfully, directory listing of $1:"
13
+ rm -rf "$1" || exit;
14
+ ls -lh;
15
+ }
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env bash
2
+ # 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.453) - https://dotfiles.io
3
+ # Copyright (c) Sebastien Rousseau 2022. All rights reserved
4
+ # License: MIT
5
+
6
+ # remove_disk: spin down unneeded disk
7
+ remove_disk () {
8
+ diskutil eject "$1"
9
+ }
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env bash
2
+ # 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.453) - https://dotfiles.io
3
+ # Copyright (c) Sebastien Rousseau 2022. All rights reserved
4
+ # License: MIT
5
+
6
+ # ren: Function to rename files extension.
7
+ ren() {
8
+ for f in *."$1"; do
9
+ mv "${f}" "${f%."$1"}.$2"
10
+ done
11
+ }
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env bash
2
+ # 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.453) - https://dotfiles.io
3
+ # Copyright (c) Sebastien Rousseau 2022. All rights reserved
4
+ # License: MIT
5
+
6
+ # rm: Function to make 'rm' move files to the trash
7
+ # function rm() {
8
+ # if [[ "$#" != 1 ]]; then
9
+ # echo "[ERROR] Please add one argument" >&2
10
+ # return 1
11
+ # fi
12
+ # rm "$1"
13
+ # }
@@ -0,0 +1,103 @@
1
+ #!/usr/bin/env bash
2
+ # 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.453) - https://dotfiles.io
3
+ # Copyright (c) Sebastien Rousseau 2022. All rights reserved
4
+ # License: MIT
5
+
6
+ # Adapted from https://github.com/Ananta-Gupta/Rock-Paper-Scissors
7
+
8
+ # rps: Function to play Rock Paper Scissors
9
+
10
+ # check() {
11
+ # if [ "$1" == "$2" ]; then
12
+ # echo "Draw!"
13
+ # elif [ "$1" = 1 ] && [ "$2" = 2 ]; then
14
+ # echo "You Lose! Paper beats Rock!"
15
+ # elif [ "$1" = 2 ] && [ "$2" = 3 ]; then
16
+ # echo "You Lose! Scissor beats Paper!"
17
+ # elif [ "$1" = 3 ] && [ "$2" = 1 ]; then
18
+ # echo "You Lose! Rock beats Scissor!"
19
+ # elif [ "$1" != 1 ] && [ "$1" != 2 ] && [ "$1" != 3 ]; then
20
+ # echo "Invalid input! You have not entered a valid number"
21
+ # else
22
+ # echo " ❭ You Win! 👏🏻"
23
+ # fi
24
+ # }
25
+
26
+ # print() {
27
+ # echo ""
28
+ # echo "┌──────────────────────────────────────┐"
29
+ # echo "│ │"
30
+ # echo "│ Rock, Paper, Scissors │"
31
+ # echo "│ │"
32
+ # echo "└──────────────────────────────────────┘"
33
+ # echo ""
34
+ # echo "Enter a choice :"
35
+ # echo "1 for Rock"
36
+ # echo "2 for Paper"
37
+ # echo "3 for Scissor"
38
+ # echo ""
39
+ # }
40
+
41
+ # rps() {
42
+
43
+ # clr=0
44
+ # i=0
45
+ # while [ $i != 1 ]; do
46
+ # if [ $clr = 0 ]; then
47
+ # clr=0
48
+ # clear
49
+ # print 1
50
+ # fi
51
+ # read -r ch1
52
+ # echo ""
53
+
54
+ # case $ch1 in
55
+ # 1)
56
+ # echo "You chose rock"
57
+ # ;;
58
+ # 2)
59
+ # echo "You chose paper"
60
+ # ;;
61
+ # 3)
62
+ # echo "You chose scissor"
63
+ # ;;
64
+ # esac
65
+
66
+ # if [ "$ch1" = 0 ] && [ "$ch1" = 3 ]; then
67
+ # echo "please choose from 1, 2 or 3."
68
+ # clr=1
69
+ # continue
70
+ # fi
71
+
72
+ # ch2=$(echo "$RANDOM%3+1" | bc)
73
+
74
+ # case $ch2 in
75
+ # 1)
76
+ # echo "The computer chose rock"
77
+ # ;;
78
+ # 2)
79
+ # echo "The computer chose paper"
80
+ # ;;
81
+ # 3)
82
+ # echo "The computer chose scissor"
83
+ # ;;
84
+ # esac
85
+
86
+ # check "${ch1}" "${ch2}"
87
+ # echo "To exit press 0"
88
+ # echo "To play again press p : "
89
+ # read -r ch3
90
+ # if [ "$ch3" = p ]; then
91
+ # rep=6
92
+ # while [ $rep != 0 ]; do
93
+ # clear
94
+ # print 1
95
+ # echo "Starting in $($rep - 1) seconds!!!"
96
+ # rep=$($rep - 1)
97
+ # done
98
+ # continue
99
+ # else
100
+ # exit
101
+ # fi
102
+ # done
103
+ # }
@@ -1,7 +1,12 @@
1
+ #!/usr/bin/env bash
2
+ # 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.453) - https://dotfiles.io
3
+ # Copyright (c) Sebastien Rousseau 2022. All rights reserved
4
+ # License: MIT
5
+
1
6
  # Show hidden system and dotfile files
2
- function showhiddenfiles() {
7
+ showhiddenfiles() {
3
8
  defaults write com.apple.Finder AppleShowAllFiles YES
4
9
  osascript -e 'tell application "Finder" to quit'
5
10
  sleep 0.25
6
11
  osascript -e 'tell application "Finder" to activate'
7
- }
12
+ }
@@ -1,5 +1,10 @@
1
+ #!/usr/bin/env bash
2
+ # 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.453) - https://dotfiles.io
3
+ # Copyright (c) Sebastien Rousseau 2022. All rights reserved
4
+ # License: MIT
5
+
1
6
  # size: Function to check a file size
2
- function size() {
7
+ size() {
3
8
  if [[ "$#" != 1 ]]; then
4
9
  echo "[ERROR] Please add one argument" >&2
5
10
  return 1
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env bash
2
+ # 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.453) - https://dotfiles.io
3
+ # Copyright (c) Sebastien Rousseau 2022. All rights reserved
4
+ # License: MIT
5
+
6
+ # stopwatch: Function for a stopwatch
7
+ stopwatch() {
8
+ date1=$(gdate +%s)
9
+ while true; do
10
+ echo -ne "$(gdate -u --date @$(($(date +%s) - date1)) +%H:%M:%S)\r"
11
+ sleep 0.1
12
+ done
13
+ }
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env bash
2
+ # 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.453) - https://dotfiles.io
3
+ # Copyright (c) Sebastien Rousseau 2022. All rights reserved
4
+ # License: MIT
5
+
6
+ # trash: Function to moves a file to the MacOS trash
7
+ #trash(){
8
+ # if [ "$#" != 1 ]; then
9
+ # echo "[ERROR] Please add one argument" >&2
10
+ # return 1
11
+ # fi
12
+ # rm "$1"
13
+ #}
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env bash
2
+ # 🅳🅾🆃🅵🅸🅻🅴🆂 (v0.2.453) - https://dotfiles.io
3
+ # Copyright (c) Sebastien Rousseau 2022. All rights reserved
4
+ # License: MIT
5
+
6
+ # tree: Function to generates a tree view from the current directory
7
+ #if [ ! -e /usr/local/bin/tree ]; then
8
+ # tree(){
9
+ # pwd
10
+ # ls -R | grep ":$" | \
11
+ # sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/'
12
+ # }
13
+ #fi