Skip to content

Instantly share code, notes, and snippets.

@Arime9
Last active August 15, 2023 02:16
Show Gist options
  • Save Arime9/8872e7fd0de83b6f0bcccf70cff250f7 to your computer and use it in GitHub Desktop.
Save Arime9/8872e7fd0de83b6f0bcccf70cff250f7 to your computer and use it in GitHub Desktop.
install binaries - .bash_profile
==== bash ====
# bash #
## Setiing PATH ##
$ echo '''
# bash''' >> ~/.bash_profile
$ echo 'export BASH_SILENCE_DEPRECATION_WARNING=1' >> ~/.bash_profile
$ echo 'function subl-bash-profile() { subl ~/.bash_profile ;}' >> ~/.bash_profile
$ echo 'function source-bash-profile() { source ~/.bash_profile ;}' >> ~/.bash_profile
==== grep ====
# grep #
## function ##
$ echo '''
# grep''' >> ~/.bash_profile
$ echo 'function grep-excludes() { grep $@ -r . --exclude-dir={.git,vendor,.mint,.bundle,.yarn,Pods,Carthage,DerivedData} ;}' >> ~/.bash_profile
==== find ====
# find #
## function ##
$ echo '''
# find''' >> ~/.bash_profile
$ echo 'function find-name() { find . -name "*$@*" ;}' >> ~/.bash_profile
==== Install Homebrew ====
# Homebrew #
## Setiing PATH ##
$ echo '''
# homebrew''' >> ~/.bash_profile
$ echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.bash_profile
$ echo 'function br() { brew $@ ;}' >> ~/.bash_profile
$ echo 'function brew-upstairs() { brew update; brew upgrade; brew cleanup; brew doctor; }' >> ~/.bash_profile
$ echo 'function brew-upstairs-greedy() { brew update; brew upgrade; brew upgrade --greedy; brew cleanup; brew doctor; }' >> ~/.bash_profile
==== Install Node.js ====
# nodebrew #
## Install ##
$ brew install nodebrew
## Setiing PATH ##
$ echo '''
# nodebrew''' >> ~/.bash_profile
$ echo 'export PATH="${HOME}/.nodebrew/current/bin:${PATH}"' >> ~/.bash_profile
## Setup ##
$ nodebrew setup
# node, npm, npx #
## Install ##
$ nodebrew install-binary stable
$ nodebrew use stable
## Checking ##
$ node -v
v10.15.1
$ npm -v
6.4.1
==== Install Ruby ====
# rbenv #
## Setting RBENV_ROOT, Execution init ##
$ echo '''
# rbenv''' >> ~/.bash_profile
$ echo 'export RBENV_ROOT='/usr/local/var/rbenv'' >> ~/.bash_profile
$ echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile
==== bundler ====
# bundler #
## Setiing PATH ##
bundle config set path vendor/bundle
## function ##
$ echo '''
# bundler''' >> ~/.bash_profile
$ echo 'function be() { bundle exec $@ ;}' >> ~/.bash_profile
$ echo 'function bef() { bundle exec fastlane $@ ;}' >> ~/.bash_profile
$ echo 'function befi() { bundle exec fastlane ios $@ ;}' >> ~/.bash_profile
$ echo 'function bep() { bundle exec pod $@ ;}' >> ~/.bash_profile
$ echo 'function bep() { bundle exec pod install ;}' >> ~/.bash_profile
==== Install Go ====
# Go #
## Install ##
$ brew install go
## Checking ##
$ go version
go version go1.14.1 darwin/amd64
## Setiing Environment ##
$ echo '''
# go''' >> ~/.bash_profile
$ echo 'export PATH="~/go/bin:${PATH}"' >> ~/.bash_profile
==== Install Java ====
# Java #
## Setting JAVA_HOME ##
$ echo 'export JAVA_HOME='/usr/libexec/java_home -v 1.8''
==== Xcode ====
# function #
$ echo '''
# Xcode''' >> ~/.bash_profile
$ echo 'function open-simulator-documents() { cd ~/Library/Developer/CoreSimulator/Devices/; cd `ls -t | head -n 1`'/data/Containers/Data/Application'; cd `ls -t | head -n 1`'/Documents'; open .; }' >> ~/.bash_profile
$ echo 'function open-simulator-file-provider-storage() { cd ~/Library/Developer/CoreSimulator/Devices/; cd `ls -t | head -n 1`'/data/Containers/Shared/AppGroup'; cd `ls -t | head -n 1`'/File Provider Storage'; open .; }' >> ~/.bash_profile
==== Install Android ====
# Android #
## Setiing PATH ##
$ echo '''
# android''' >> ~/.bash_profile
$ echo 'export PATH="/Applications/Android Studio.app/Contents/jre/Contents/Home/bin:${PATH}"' >> ~/.bash_profile
$ echo 'export JAVA_HOME="/Applications/Android Studio.app/Contents/jre/Contents/Home"' >> ~/.bash_profile
$ echo 'export ANDROID_SDK_ROOT="~/Library/Android/sdk"' >> ~/.bash_profile
$ echo 'export PATH="${ANDROID_SDK_ROOT}/platform-tools:${PATH}"' >> ~/.bash_profile
==== .gitignore.io ====
# .gitignore.io #
## function ##
$ echo '''
# .gitignore.io''' >> ~/.bash_profile
$ echo 'function gi() { curl -sL https://www.gitignore.io/api/$@ ;}' >> ~/.bash_profile
==== Markdown Misc ====
# Markdown to HTML #
## function ##
$ echo '''
# Markdown to HTML''' >> ~/.bash_profile
# example: $ md-to-html-img '![Simulator-Screenshot](https://github.com/Arime9/hoge-repository/assets/8828318/7eb78a30-a278-4ed6-9bf8-b49fa3666e00)'
# function md-to-html-img() {
# echo $@ | sed -e "s/^.*(/<img src=\"/g" -e "s/)$/\" width=\"240\">/g" | pbcopy
# }
==== Bash Commands ====
# Bash #
## Loading Files ##
$ source ~/.bash_profile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment