Code Monkey home page Code Monkey logo

bash-functions's Introduction

๐Ÿ”ฎ bash-functions

A collection of useful Bash/ZSH functions. Just drop the functions from .bashrc at the end of your .bashrc or .zshrc. These work great with the MacBook touch bar and iTerm2.

Usage

๐Ÿ“ฆ Open a module on npmjs.com

From anywhere:

npmjs # opens npmjs.com
npmjs <module> # opens npmjs.com for npm module <module>

From a git repo:

npmjs # opens npmjs.com for npm module <git-repo>

๐Ÿค– Clone any repo and ๐Ÿšš cd into it

From anywhere:

clone url # clone a repo from any git URL and cd into it
clone org repo # clone a repo from GitHub and cd into it
clone org/repo # clone a repo from GitHub and cd into it

๐Ÿด Fork a GitHub repo

From anywhere:

ghfork url # fork a repo from any GitHub URL and cd into it
ghfork org repo # fork from GitHub and cd into it
ghfork org/repo # fork from GitHub and cd into it

๐Ÿ™ Open GitHub

From anywhere:

github # opens GitHub
github org # opens GitHub for org
github org/repo # opens GitHub for org/repo
github org repo # opens GitHub for org/repo

From a git repo:

github # opens this repo in GitHub for current branch
github <branch> # opens this repo in GitHub for specified branch

๐Ÿ”ƒ Open the pull requests for a repo

From anywhere:

pulls # opens GitHub for all pull requests for user
pulls org repo # opens GitHub for all pull requests for org/repo

From a git repo:

pulls # opens GitHub for all pull requests for this repo

โœ๏ธ Create a pull request for a repo

From anywhere:

pr <org> <repo> <base> <branch> # opens GitHub to draft a pull request in org/repo to merge <branch> into <base>

From a git repo:

pr # opens GitHub to draft a pull request in this repo to merge the current branch into master
pr <base> # opens GitHub to draft a pull request in this repo to merge the current branch into <base>
pr <base> <branch> # opens GitHub to draft a pull request in this repo to merge <branch> into <base>

๐Ÿ”ฌ Review and test a pull request for a repo

From a git repo:

review <number> # checks out PR #<number> into a local branch named <number> for review/testing
review <number> <branch> # checks out PR #<number> into a local branch named <branch> for review/testing

๐Ÿ’ป iTerm2 Touch Bar Support

iTerm2 Touch Bar

In iTerm2, navigate to Preferences > Keys and Add Touch Bar Item for each of the following items. After, navigate to the View dropdown > Customize Touch Bar... and drag them where you'd like ๐Ÿ˜Ž.

Npm

Label: ๐Ÿ“ฆ

Action: Send Text with "vim" Special Chars

npmjs\r

Clone

Label: ๐Ÿค–

Action: Send Text

clone YourOrg

VS Code / Atom / Sublime

Label: ๐Ÿšง or ๐Ÿ”ญ or ๐Ÿ‘ฉโ€๐Ÿ’ป or ๐Ÿ‘จโ€๐Ÿ’ป or โš›๏ธ

Action: Send Text with "vim" Special Chars

code .\r or atom .\r or subl .\r

Git Pull

Label: ๐Ÿ‘‡

Action: Send Text with "vim" Special Chars

git pull\r

Git Push

Label: ๐Ÿ‘†

Action: Send Text

git push

GitHub

Label: ๐Ÿ™

Action: Send Text with "vim" Special Chars

github\r

Git Status

Label: ๐Ÿ“Ÿ

Action: Send Text with "vim" Special Chars

gst\r

Npm Install

Label: ๐Ÿ“€

Action: Send Text with "vim" Special Chars

npm i\r

Npm Start

Label: โšก๏ธ or ๐Ÿ

Action: Send Text with "vim" Special Chars

npm start\r

Npm Test

Label: ๐Ÿ”ฌ

Action: Send Text with "vim" Special Chars

npm t\r

Draft PR

Label: โœ๏ธ

Action: Send Text with "vim" Special Chars

pr\r

View PRs

Label: ๐Ÿ”ƒ

Action: Send Text with "vim" Special Chars

pulls\r

Spotify Play/Pause

NOTE: Requires shpotify.

Label: ๐ŸŽธ or ๐ŸŽง or ๐ŸŽต or ๐ŸŽท

Action: Send Text with "vim" Special Chars

spotify pause\r

Sponsorship ๐ŸŽ—

If you found this project useful, please consider becoming a sponsor on GitHub.

bash-functions's People

Contributors

nathanchapman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.