Giter Site home page Giter Site logo

my-helper-zfunctions's Introduction

Custom zsh functions

helper zsh functions written by yours truly to make my (and maybe your) coding life just a little easier. Maybe learn something in the process.

Scaffold-practice

This one is a quick way to setup the file system in a specified inside the script directory for praticing problems on HackerRank.com It took me forever to actually write it with almost all bells and whistles of an actual shell script. always wanted to learn how to create scripts that handle flags as well as arguments. Well, vio la!

If you are using zsh or other shells that source / . the custom scrits, make sure to mention that in your research of the builtin commands you'd like to use!!! read builtin, for instanse, requires a coprocess if sourced or a completely different syntax for displaying a prompt to the user in the terminal and saving to a variable.

Usage:

$ scaffold-practice [-flags] <dirName> <functionName> <variables>
<dirName> - required, specify the name of a new directory to be created (name of the problem) inside ~/Dev_Projects/Toptal_test_prep
<functionName> - required, specify the name of the function
<variables> - required, comma separated, no whte spaces characters used in the problem for input variables

[-flags]:
-h prints out this message
-n prevents Nodemon from launhing automatically

git-lc

Runs git add . -v and git commit -m ${message}. It now has the -h flag to show usage and tests for existance of the message.

Usage:

$ git-lc [-flags] "commit message"
git-lc - add all files and commit locally with a meassage
"commit message" - required, the message assigned to the commit

[-flags]:
-h prints out this message

git-up

In addition to the commands enclosed in git-lc also has the ability to push changes on the current local branch to a remote named 'origin' (just the name I always use 99% of the time) either to the identically named remote branch (with a -s flag) or to a new branch.

By default, it takes 2 arguments [remote-branch-name] "commit message" adds all files, creates a new commit with the specified message, if there are new changes on the current local branch, and pushes them to the provided branch. If the specified branch doesn't exist on the remote - the script creates one.

Usage:

$ git-up [-flags] <remote-branch-name> "commit message"

git-up - add all files, commit with a meassage and push the current branch to a <remote-branch-name>
"commit message" - message assigned to the commit

[-flags]:
-h prints out this message
-p Previous. Uses the last commit; "commit message" argument is skipped
-s Same (branches). Pushes changes to the branch with the same name as the current one. <remote-branch-name> ignored

my-helper-zfunctions's People

Contributors

kolchurinvv avatar

Watchers

 avatar

my-helper-zfunctions's Issues

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.