musicMan1337 / dot_files

JSON Snippets for use with various languages in VScode

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Contributors Forks Stargazers Issues MIT License LinkedIn


Logo

My Personal "dot" Files

My personal dumping ground for my secrets to optimal laziness!
Explore the docs »

Report Bug · Request Feature?


gitBash || WSL-Ubuntu || hereDocs

First you get the money, then you get the powerlevel10k......

Logo

I won't get into the specifics on setting up WSL here, but know that I personal run Ubuntu on my local Network, using oh-my-zsh terminal and the powerlevel10k theme. That said, shell-specific scripts will need minor tweaking depending on your own personal dev environment!

Shell Aliases:

An alias is basically a variable that you can assign a shell script to, then run it in the terminal. For example:
Logo
...ran in terminal...
Logo
You can create aliases mainly two ways:
  1. In the terminal, for a temporary alias:
Logo
  1. In your .bashrc file, for a permanent alias:
Logo
Note your .bashrc should be located in your root directory (cd ~). If by chance it doesn't exist, just create one!

Git Aliases:

Git aliases function the same way as shell aliases, but have somewhat different syntax. You could technically create shell aliases to do the same thing, though I personally like separating git and shell aliases.
You can create git aliases in your .gitconfig file located in your rootdirectory. It should have been created and filled with some stuff after using git for the first time, but if it's not there you can always create your own .gitconfig from scratch.
  • In your .gitconfig file, create aliases in the designated area:
Logo
  • You can then invoke the git-specific alias in the terminal:
Logo
Note your .bashrc should be located in your root directory (cd ~). If by chance it doesn't exist, just create one!
Also, these are just very basic use cases, and there ar many advanced ways to create scripts such as using functions, combining scripts, using variables, and much more...

Here Docs:

(are OP...)

Here Docs are fairly complex, but on the surface level they are basically just fields of text that can either run complex scripts or create new files populated with said text.
1. I'd suggest creating a folder specifically for your hereDocs in your root directory, and treat the folder itself as a type of .bashrc file, where your "aliases" are actually hereDoc files.
2. The easiest way to create a hereDoc is to create a new .txt file (testDoc.txt)
Note that hereDocs don't need to strictly be .txt, nor are there naming conventions for the file name. Basically, you just need to be able to edit the text within the file
3. Let's create 2 simple hereDocs - create test.txt then open:
  • For running a script, the file itself acts like an alias:
Logo

...in terminal, invoke with shell name (here I'm using zsh)...

Logo
  • For generating a new file, you'll need to use "delimiters" (here it's "EOS", but it could be anything as long as the match) to wrap the body of your doc, prefaced by a command. In this case, since we aren't running scripts at the end, we only need an opening delimiter:
Logo

...in terminal, cd into hereDocs folder...

Logo
  • This will have created a new index.js file loaded with boilerplate - you can see how this can be abused for some incredibly powerful use cases! If you'd like an example, look at my aliases and checkout "srclean" - this deletes all the files in creat-react-app and repopulates them with fresh files via hereDocs in under 1 second!
Note that this hardly scratches the surface of Here Docs, so if you'd like to learn more... Explore the docs! »

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Contact

Facebook - Derek Nellis

Instagram - @derek.8bit.nellis

Github - musicMan1337

About

JSON Snippets for use with various languages in VScode


Languages

Language:Shell 100.0%