Skip to content

Instantly share code, notes, and snippets.

@melaniehoff
Last active August 5, 2021 19:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save melaniehoff/f0d4f30c2ff460a876c4f085b9bc76e6 to your computer and use it in GitHub Desktop.
Save melaniehoff/f0d4f30c2ff460a876c4f085b9bc76e6 to your computer and use it in GitHub Desktop.

Helpful Codes which may or may not be useful

These lines of code are meant to be run in your terminal by pasting and pressing enter one after the other.

For newer Mac's to switch from zsh to bash

  • chsh -s $(which bash)
    OR
  • chsh -s /bin/bash
  • More info here

Bash for loop

for i in {1..2000}; do printf ' ♡ 📂 → ➩ ➪ ➫ ➬ ➭ ➮ '; done; will create an emoji for loop


🔮 folder-spell

folder-spell is a folder poetry generator that came out of a conversation our TA Brian Solon and i had on the bus yesterday. It makes writing sentences with folders go very quickly.

  • It creates a series of nested folders with a text file at the end.
  • The first words you write after folder-spell will become a series of nested folders. The text within quotations will become the contents of a text file.

Installation

  • enter the entire following line in your terminal
    • curl https://gist.githubusercontent.com/solon/27106a5389c61dcb83fb25fa9c20787d/raw/folder-spell.sh > ~/folder-spell.sh && chmod u+x ~/folder-spell.sh && echo $'folder-spell() {\n ~/folder-spell.sh \"$@\" \n}' >> ~/.bash_profile
  • source ~/.bash_profile

Usage

  • folder-spell these are words "this is some text"

  • Another example usage:

    • folder-spell this is a folder poem generator "the first words you write will become a series of nested folders. The text within quotations will become the contents of a text file"

Installing homebrew to use the tree command

  • /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • brew install tree

To change your computer's hostname (Mac)

  • sudo scutil --set HostName new_hostname
  • restart your computer

To remove "(base)" from prepending the bash prompt after installing Anaconda:

  • conda config --set auto_activate_base False
  • source ~/.bash_profile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment