Skip to content

Instantly share code, notes, and snippets.


Lovisa Svallingson biglovisa

View GitHub Profile
View gist:eeef2a20bb7518c3a40b33b3e804d7b3
## Let's set up our dotfiles
### Part 1: Set up your dotfile repository
1. cd to your root directory (cd)
2. create a dotfiles directory (mkdir dotfiles)
2.5 run (git init) to initialize it as a git repository
3. run either a (touch .zsh_profile.zsh) file or a (touch .bash_profile) file
- zsh/bash depends on your shell. run (echo $SHELL ) in order to find out what shell you have
- if you already have a {zsh,bash}_profile file in your root directory, copy over the contents
View gist:0da65883fc91d40dd013ebf9b6d221cf
Note: I'm not giving you any interaction patterns so that you get the chance to construct your own.
- Given a word, find all of it's anagram in the (English) dictionary
- Given a string, determine whether or not it is a palindrome
- Implement a vending machine. I want to be able to buy, restock, and see what the current inventory is.
- To consider:
View gist:cec6a34fa88293e7e1c37f57bde44a72
# Git
## Source control
- Keep historical log of what has changed
- Helps when you want to collaborate with other people
- Safer way to ship software
## Concepts
biglovisa / sh.txt
Created Apr 4, 2018
Shell and such
View sh.txt
What is the terminal
a program that emulates the terminal
iterm or terminal most commonly
What is the shell
a program that takes commands from the keyboard and gives them to the operating system to perform
operating system is what "does all the things"
performs tasks
recognizes keyboard input
biglovisa / report-card.html
Created Jun 1, 2017
Starter HTML for dom lesson
View report-card.html
<h1>Report Card</h1>
<p>Student Name: <span class="student">Your Name Here</span></p>
<li>Physics, <span class="grade">D</span></li>
<li>Calculus 2, <span class="grade">F+</span></li>
<li>English Literature, <span class="grade">E</span></li>
biglovisa /
Created May 9, 2017
iteration exercises

Iterating over collections

Summing integers

  • Given the array numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], iterate over the array and add all numbers together.

Multiplying and summing integers

  • Given the array numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], iterate over the array and multiply all the integers by themselves, and sum them together.
biglovisa /
Created May 9, 2017
Array exercises

Array exercises


  • Create an empty array
  • Add a few elements to the end of the array
  • Add an element to the beginning of the array
  • Remove the last element from the array
  • Remove the first element from the array
  • Given an array containing the elements: "orange", "carrot", "lemon", "pomegranate", "blood orange", "apple"

Functions: exercises

  • Answer the following questions with the person sitting next to you:

    • What does a function return by default?
    • What is the return keyword? What does it do?
    • Do you always have to give a function a name?
    • What is the difference between this: myFunctionName and myFunctionName()?
    • What is the function signature?
  • Create a function which takes the arguments name and jobTitle.

biglovisa /
Last active May 10, 2017
Functions: check-ins


Check-ins 1

  • What is a function? Give an example of a daily task which could be abstracted into a function.
  • In your console, create a named function and an anonymous function.
  • Create a function called myFunctionName. What does myFunctionName return? What does myFunctionName() return?
  • What does a function return by default?
  • Create a function which returns "You are the world's greatest" when invoked.
biglovisa /
Created May 4, 2017
Control flow: check-ins

Control Flow

Student grades

  • Create an if/else statement which tells you if a student should get an A, B, C, or D based on their score.
    • A: 100 - 95
    • B: 94 - 85
    • C: 84 - 75
    • D: 74 or below
You can’t perform that action at this time.