Skip to content

Latest commit

 

History

History
76 lines (64 loc) · 3.09 KB

workflow.md

File metadata and controls

76 lines (64 loc) · 3.09 KB

JumpStart Live (JSL)

Day 1

Workflow

MacOSX splitting your screen

There are number of ways to split your screen, and move your windows around, a few options are listed below

  • Native to MacOSX, use Desktops and Split Views
  • Install Spectacle (Free)
  • Install Moom ($10)
  • Install Divvy ($13.99)

Terminal

When programming you should always have a Terminal window open

Opening Terminal

  • cmd+spacebar to open spotlight, then type Terminal
  • Drag Terminal to your Dock (if it's not already there)

Terminal commands

Command Description
cmd + K clear your screen
touch <filename> creates a new file named filename
pwd prints the working directory (displays the full path of the current directory)
cd choose a directory
cd .. go back a directory
cd ~ choose home directory
ls list the items in the directory
ls -a list the items in the directory, including hidden files
mkdir make a new directory
rm <filename> removes the file named filename
rm -r <dirname> removes the directory (and everything in it) named dirname
view the previous command
ctrl + a go to beginning of line
ctrl + e go to end of line
alt + → move to the right, one word
alt + ← move to the left, one word
ctrl + c interrupt or stop a command

irb commands

Command Description
irb start interactive ruby session
exit exit an irb session
ctrl + c interrupt or stop a command

Running Ruby files in Terminal

  • Type ruby followed by the name of the Ruby file (e.g., ruby hello_world.rb)

Atom

  • In Atom, click the Atom menu and then Install Shell Commands
  • Now, to launch Atom from terminal, type atom followed by the file name or directory name

Bash Profile

  • .bash_profile is a hidden file in your user directoy that you can edit to customize the terminal prompt (among a number of other things)
  • Type atom ~/.bash_profile to open it (if it doesn't already exist, this command will create it)

PS1

  • PS1 is the enviornment variable for the bash prompt
  • PS1 stands for Prompt String 1, there is also PS2, PS3, and PS4
  • The default string stored in PS1 is \s-\v\$
  • To change PS1, add export PS1=" " to your .bash_profile (no spaces on either side of the equal sign)
  • Add anything in the quotes that you would like (some options below)
    • \s – name of shell (e.g., bash)
    • \v – version of bash
    • \d – current date
    • \t – current time
    • \u – user name
    • \W – current working directory
    • You can even add emoji, in Atom, click Edit > Emjoi & Symbols
  • When you are done editing, save in Atom and then type source ~/.bash_profile in Terminal to apply the changes

Resources