Skip to content

Instantly share code, notes, and snippets.

@martimatix
Last active August 29, 2015 14:13
Show Gist options
  • Save martimatix/e018b8a5f02e5e1b45b0 to your computer and use it in GitHub Desktop.
Save martimatix/e018b8a5f02e5e1b45b0 to your computer and use it in GitHub Desktop.
Notes from WDI Week 1

#Command Line Just jotting down the ones that I didn't know about.

  • top Table of processes

  • whoami

  • open . open in finder

  • cd - Effectively a 'back' in windows

  • ls -la long listing that lists hidden files

  • cat (eg cat readme) Displays the file

  • open -a "Sublime Text" [filename] Long way to open something in Sublime 3

  • Add the following to ~/.bash_profile so that files can be opened easily in sublime alias subl="open -a 'Sublime Text'"

  • Also add the following to .bash_profile to alter your bash prompt profile PS1="\W $ "

  • ctrl-d closes terminal tab

  • rm -rf / deletes your hard drive; The flag r is for recursive and f is for force

  • which as in which ruby tells you the directory the command lives in

  • alias lists aliases

  • Useful aliases: l for ls -la and b for cd ..

  • man manual

#Git

#Ruby

  • Discusssion about syntax
  • Backslash for escaping chracters
  • snake case "hello_world"
  • camel case "HelloWorld"
  • constants are defined using all caps
  • #{} is known as string interpolation
  • Hash.new("brown") creates a hash where the default value is "brown"
  • Exercises from RubyMonk

#Git Intro

Useful commands

  • git status
  • git add Can specify a file or just give a directory
  • git push does the same thing as git push origin master
  • git clone
  • git log Shows you what has happened recently. Not so useful for projects with lots of commits.
  • git remote add origin https://github.com/try-git/try_git.git
  • git diff HEAD tells you what's different if someone adds something to the remote repository not on your local
  • git checkout -- octocat.txt Gets rid of all the changes from octocat.txt
  • git reset octofamily/octodog.txt If you've commited octodog.txt, you uncommit it
  • git branch _____ creates a new branch
  • git checkout ______ switch to branch
  • git merge _____ merge branch into master
  • git branch -d clean_up deletes branch clean_up

Interesting points

  • Can commit just the first 15 lines of the file
  • Origin master refers to the online repo
  • Github does not own Git

#Ruby Flow

Conditionals

Functions

Lab: Calculator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment