Giter Site home page Giter Site logo

gabrielalonsocabral / utils-aliases-functions Goto Github PK

View Code? Open in Web Editor NEW
6.0 1.0 0.0 26 KB

Utils Aliases Functions helps you to replace manual tasks for functions in bash terminal globally.

JavaScript 44.41% Python 50.38% Shell 5.21%
bashrc child-process fs javascript path zshrc

utils-aliases-functions's Introduction

Utils Aliases Functions

Utils Aliases Functions helps you to replace manual tasks for functions in bash terminal globally.
If you wish to use Javascript or another programming language instead the common SH Functions this is the correct repository.

Developed by: @GabrielAlonsoCabral

Installation

# clone this repository
$ git clone https://github.com/GabrielAlonsoCabral/utils-aliases-functions.git .aliases
$ cd .aliases

Configure Your Environment

AWS Credentials

  1. Inside .credentials/ Replace your aws.credentials.example.json by aws.credentials.json
  2. Replace profiles in JSON by your aws profiles

MacOS

Add this code lines on your ~/.zshrc

export ALIASES_PATH="$HOME/.aliases"
export AWS_PATH="$HOME/.aws"        
export GH_NAME="ADD_YOUR_GITHUB_NAME"

function toggleAwsProfile {
    currentPath=$PWD;
    cd $ALIASES_PATH;
    node $ALIASES_PATH/functions/toggle-aws-profile.js;
    cd $currentPath;
}

function showAwsProfile {
    currentPath=$PWD;
    cd $ALIASES_PATH;
    node $ALIASES_PATH/functions/show-aws-profile.js;
    cd $currentPath;
}  

function commit (){
  /usr/bin/python $ALIASES_PATH/functions/commit.py "$@"
}

function pull (){
  /usr/bin/python $ALIASES_PATH/functions/pull.py "$@"
}

function push (){
  /usr/bin/python $ALIASES_PATH/functions/push.py "$@"
}

function branch (){
  /usr/bin/python $ALIASES_PATH/functions/branch.py "$@"
}

function portkill (){
  sh $ALIASES_PATH/functions/portkill.sh "$@"
}

Enable Changes

$ source ~/.zshrc

Linux

Add this code lines on your ~/.bashrc

export ALIASES_PATH="$HOME/.aliases"
export AWS_PATH="$HOME/.aws"    
export GH_NAME="ADD_YOUR_GITHUB_NAME"

function toggleAwsProfile {
    currentPath=$PWD;
    cd $ALIASES_PATH;
    node $ALIASES_PATH/functions/toggle-aws-profile.js;
    cd $currentPath;
}

function showAwsProfile {
    currentPath=$PWD;
    cd $ALIASES_PATH;
    node $ALIASES_PATH/functions/show-aws-profile.js;
    cd $currentPath;
}

function commit (){
  python3 $ALIASES_PATH/functions/commit.py "$@"
}

function pull (){
  python3 $ALIASES_PATH/functions/pull.py "$@"
}

function push (){
  python3 $ALIASES_PATH/functions/push.py "$@"
}

function branch (){
  python3 $ALIASES_PATH/functions/branch.py "$@"
}

function portkill (){
  sh $ALIASES_PATH/functions/portkill.sh "$@"
}

Enable Changes

$ source ~/.bashrc

Usage

# Show your default AWS Profile 
$ showAwsProfile

# Toggle your default AWS Profile 
$ toggleAwsProfile

# Create a git branch with name pattern (ex: "GabrielAlonsoCabral/TITLE")
$ branch --name "TITLE"

# Push your current branch to remote origin
$ push

# pull your current branch with master
$ pull

# Add your changed files and commit it with pattern name
$ commit

# Add your changed files and commit it with pattern name and open pull request
$ commit --pr

# Kill process running in PORT 3000
$ portkill 3000

utils-aliases-functions's People

Contributors

gabrielalonsocabral avatar

Stargazers

 avatar  avatar  avatar

Watchers

 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.