diff --git a/README.md b/README.md index f312de8..f92d47b 100644 --- a/README.md +++ b/README.md @@ -11,11 +11,11 @@ Welcome to Code 102! We're going to spend five nights covering the essentials of ## Resources * Keyboard Shortcuts - * [Mac](http://www.danrodney.com/mac/) - * [Windows](http://www.hongkiat.com/blog/100-keyboard-shortcuts-windows/) + * [Mac](http://www.danrodney.com/mac/) + * [Windows](http://www.hongkiat.com/blog/100-keyboard-shortcuts-windows/) * Text Editors - * [The Basics of vi](http://www.bsdguides.org/2004/the-basics-of-vi/) - * [The Basics of nano](https://wiki.gentoo.org/wiki/Nano/Basics_Guide) + * [The Basics of vi](http://www.bsdguides.org/2004/the-basics-of-vi/) + * [The Basics of nano](https://wiki.gentoo.org/wiki/Nano/Basics_Guide) * Visual Studio Code * [The Basics of Visual Studio Code](https://code.visualstudio.com/Docs/editor/codebasics) * [VS Code Key Bindings](http://www.hongkiat.com/blog/key-binding-management-visual-studio-code/) diff --git a/code/friday.js b/code/friday.js index f3d774a..09d908f 100644 --- a/code/friday.js +++ b/code/friday.js @@ -2,10 +2,10 @@ // After each TODO, once you get the code working, stop and add/commit // your changes to your repository. -// TODO: Copy in your completed code from Wednesday. +// TODO: Copy in your completed code from Thursday. // TODO: Refactor all the code into a single big function -// called dayApp(). +// called dayApp(). Be sure to work incrementally! // TODO: What happens if you reload the page now? @@ -15,7 +15,7 @@ // TODO: Refactor the math that gets a random day number // into a function called getDayNumber(). -// TODO: Refactor the if/elseif/else block that comments +// TODO: Refactor the if/else if/else block that comments // on each day into this function: function remarkOnDay(day) { diff --git a/code/thursday.js b/code/thursday.js index 69eb617..72485f1 100644 --- a/code/thursday.js +++ b/code/thursday.js @@ -1,55 +1,59 @@ -var day = 'Thursday', - thursday = 'thursday'; - -// How many equals signs does it take to screw your code? -if (day = 'thursday') { - console.log('Test 1: Well lookee there, it\'s ' + day); -} - -// The case of the failing "if" statement -if (day == 'Thursday') { - console.log('Test 2: Lo and behold, it\'s ' + day); -} - -// Equals thrice, test once -if (day === 'Thursday') { - console.log('Test 3: Huh. It\'s ' + day); -} - -// TODO: After commenting out the 3 conditionals above, -// uncomment this code and run it. +// var day = 'Thursday'; +// var thursday = 'thursday'; +// +// // How many equals signs does it take to muck up your code? +// // if (day = 'thursday') { +// // console.log('Test 1: Well lookee there, it\'s ' + day); +// // } +// +// // The case of the failing "if" statement +// if (day == 'Thursday') { +// console.log('Test 2: Lo and behold, it\'s ' + day); +// } +// +// // Equals thrice, test once // if (day === 'Thursday') { -// console.log('Is it Friday yet?'); -// } else { -// console.log('Whistle while you work!') +// console.log('Test 3: Huh. It\'s ' + day); // } - -// TODO: Add an "else if" block to check whether it's Saturday -// and console.log() a different statement for the weekend. - - - -// TODO: Modify the conditional for Saturday to check whether -// the day is Saturday OR Sunday. - - - -// TODO: Add an "else if" block to check whether it's Monday -// and console.log() a different statement for Monday. - - - -// TODO: Change the string that's assigned into the day -// variable and run the code several times. +// +// // TODO: After commenting out the 3 conditionals above, +// // uncomment this code and run it. +// // if (day === 'Thursday') { +// // console.log('Is it Friday yet?'); +// // } else { +// // console.log('Whistle while you work!') +// // } +// +// // TODO: Add an "else if" block to check whether it's Saturday +// // and console.log() a different statement for the weekend. +// +// +// +// // TODO: Modify the conditional for Saturday to check whether +// // the day is Saturday OR Sunday. +// +// +// +// // TODO: Add an "else if" block to check whether it's Monday +// // and console.log() a different statement for Monday. +// +// +// +// // TODO: Change the string that's assigned into the day +// // variable and run the code several times. var days = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']; -// console.log('index 0: ' + days[0]); +// console.log('index ' + i + ': ' + days[i]); // console.log('index 1: ' + days[1]); // console.log('index 2: ' + days[2]); +// console.log('index 3: ' + days[3]); +// console.log('index 4: ' + days[4]); +// console.log('index 5: ' + days[5]); // console.log('index 6: ' + days[6]); +// // console.log('index 7: ' + days[7]); // console.log('index 20: ' + days[20]); @@ -58,8 +62,22 @@ var days = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', // console.log('index ' + i + ': ' + days[i]); // } - +// What if we want to iterate over the Klingon days? +// days = [ +// 'DaSjaj', +// 'povjaj', +// 'ghItlhjaj', +// 'loghjaj', +// 'buqjaj', +// 'ghInjaj' +// ]; +var times = ['morning', 'noon', 'night']; // TODO: Replace the "7" in "i < 7" with the length of the array +for (var i = 0; i < days.length; i++) { + for (var j = 0; j < times.length; j++) { + console.log('It is ' + times[j] + ' on ' + days[i]); + } +} // TODO: On each iteration, use our randomly generated dayNumber diff --git a/code/tuesday.js b/code/tuesday.js index 8056863..c1ef62e 100644 --- a/code/tuesday.js +++ b/code/tuesday.js @@ -13,15 +13,15 @@ console.log('the day is: ' + day); var monday = 'monday'; var tuesday = 'tuesday'; var wednesday = 'wednesday'; -// console.log('the variable monday contains: ' + monday); -// console.log('the variable tuesday contains: ' + tuesday); -// console.log('the variable wednesday contains: ' + wednesday); + console.log('the variable monday contains: ' + monday); + console.log('the variable tuesday contains: ' + tuesday); + console.log('the variable wednesday contains: ' + wednesday); monday = tuesday; tuesday = wednesday; -// console.log('the variable monday contains: ' + monday); -// console.log('the variable tuesday contains: ' + tuesday); -// console.log('the variable wednesday contains: ' + wednesday); + console.log('the variable monday contains: ' + monday); + console.log('the variable tuesday contains: ' + tuesday); + console.log('the variable wednesday contains: ' + wednesday); var number = 1; var numberString = '1'; @@ -33,5 +33,5 @@ var numberString = '1'; // number // numberString -// console.log('the type of variable number is: ' + typeof number); -// console.log('the type of variable numberString is: ' + typeof numberString); + console.log('the type of variable number is: ' + typeof number); + console.log('the type of variable numberString is: ' + typeof numberString); diff --git a/notes/monday.md b/notes/monday.md new file mode 100644 index 0000000..c6a6175 --- /dev/null +++ b/notes/monday.md @@ -0,0 +1,21 @@ + +We will get into the habit of uploading everynight! + +"add changes" + +git status +git add -p + +git status +git commit -m "Add Monday notes" + +git status +git remote -v + +git push origin master + +git status +git add -p +git status +git commit -m "add Monday notes" + diff --git a/notes/thursday-frankseaman.md b/notes/thursday-frankseaman.md new file mode 100644 index 0000000..ce01362 --- /dev/null +++ b/notes/thursday-frankseaman.md @@ -0,0 +1 @@ +hello diff --git a/notes/thursday-jenniferelton.md b/notes/thursday-jenniferelton.md new file mode 100644 index 0000000..1e6c410 --- /dev/null +++ b/notes/thursday-jenniferelton.md @@ -0,0 +1,3 @@ +DRY- Don't repeat yourself + +Code is always best at it shortest diff --git a/notes/tuesday.md b/notes/tuesday.md new file mode 100644 index 0000000..2639aeb --- /dev/null +++ b/notes/tuesday.md @@ -0,0 +1,46 @@ +# Tuesday notes + +var day = 'Monday'; +console.log('the day is: ' + day); + +day = 'Tuesday'; +console.log('the day is: ' + day); + +day = 'Thursday'; +console.log('the day is: ' + day); + +day = 1; +console.log('the day is: ' + day); + +var monday = 'monday'; +var tuesday = 'tuesday'; +var wednesday = 'wednesday'; +// console.log('the variable monday contains: ' + monday); +// console.log('the variable tuesday contains: ' + tuesday); +// console.log('the variable wednesday contains: ' + wednesday); + +monday = tuesday; +tuesday = wednesday; +// console.log('the variable monday contains: ' + monday); +// console.log('the variable tuesday contains: ' + tuesday); +// console.log('the variable wednesday contains: ' + wednesday); + +var number = 1; +var numberString = '1'; +// console.log('the variable number contains: ' + number); +// console.log('the variable numberString contains: ' + numberString); + +// TODO: What if we look at these in the console? +// In the console, type: +// number +// numberString + +// console.log('the type of variable number is: ' + typeof number); +// console.log('the type of variable numberString is: ' + typeof numberString); +======= +* Student questions: + * for loops vs. for/in loops (will discuss Wednesday) + * syntax & resources (Duckett book, MDN) + * case sensitivity in boolean comparisons + + diff --git a/notes/vi_practice.md b/notes/vi_practice.md new file mode 100644 index 0000000..5794818 --- /dev/null +++ b/notes/vi_practice.md @@ -0,0 +1,24 @@ +## vi practice worksheet + +For a list of commands, view the vi cheat sheet in the resources directory in this reposiorty + +After completing each of these tasks, press the `` key to return to Command mode. + +#### Go to a specific line, and add to end of line. +Add your name to the following line. Position the cursor on line `n` by entering `nG` and pressing enter, then type `A` + +Hello my name is + +#### Insert a line +move your cursor using the `j` and `k` keys to the line with `two`, then press `o` and add the missing list item. + +* one +* two +* four + +#### Find, delete and add text at cursor +position the cursor at `East` by typing `/East` and pressing enter. Press `n` until you're at the incorrect word. Delete the word by typing `dw`. Then press `i` and enter the proper descriptor. + +Code Fellows PDX is located on the East side of the river. + +#### diff --git a/notes/wednesday.md b/notes/wednesday.md new file mode 100644 index 0000000..347f5b4 --- /dev/null +++ b/notes/wednesday.md @@ -0,0 +1,21 @@ + +When working on a big project, you will not be able to work on the original repository. You CAN fork(clone) a copy to your own computer. You can make the changes or new code to your forked version. When you are done with your changes, you will have to do a "pull" from the original repository. +To do this, +git pull upstream "name of the original repository". +Then finish your code. turn into the powers that be. + +to create a branch +git branch 'name of file' +git checkout wednesday +git status + +functions +named functions + + +object constructors +paramenters-how many + +this is a change for wednesday +this is getting better + diff --git a/resources/atom.md b/resources/atom.md new file mode 100644 index 0000000..3c58bb6 --- /dev/null +++ b/resources/atom.md @@ -0,0 +1,15 @@ +# Working in Atom + +## Getting Started +1. Open your class repo in Atom: **File > Add project folder...** +2. Close extra panes/windows +3. Toggle your file view sidebar with Cmd-M / Ctrl-M +4. Create a file for Monday in the `/notes` folder (call the file `monday.md`) + +## Installing a Terminal Plugin +1. **Atom > Preferences** (or Cmd-, / Ctrl-,) +2. Go to **Install** (NOT Packages) +3. In the search box, type: platformio-ide-terminal +4. Install the package +5. Return to your notes file for Monday +6. Open a terminal window by clicking the little terminal icon in the bottom toolbar, or by using Cmd-Shift-T / Ctrl-Shift-T diff --git a/resources/bash_aliases.md b/resources/bash_aliases.md index e1c52e5..dc956b4 100644 --- a/resources/bash_aliases.md +++ b/resources/bash_aliases.md @@ -1,13 +1,22 @@ - -Copy the following small block to your `.bashrc` file: - -``` bash -if [ -f ~/.bash_aliases ]; then - . ~/.bash_aliases -fi -``` - -Copy the large text block below to your home directory as `.bash_aliases`, then type `source ~/.bashrc` to reload the file. +## Setting up aliases in bash + + +1. open a new terminal window, confirm that it is in your home directory by typing `cd` +1. look for the following two (hidden) files in your home directory: `.bashrc` or `.bash_profile`. If they don't both exist, create them: `touch ~/.bashrc ~/.bash_profile`2 +1. open the `.bashrc` file with the command `vi ~/.bashrc` +1. press `I` to enter insert mode, and copy the following block into the file: +`[[ -s ~/.bash_aliases ]] && source ~/.bash_aliases` +1. press `esc` to enter command mode, then type `:wq` and press enter to save and exit. +1. open the `.bash_profile` file in the same way: `vi .bash_profile` +1. press `I` to enter insert mode, and copy the following block into the file: +`[[ -s ~/.bashrc ]] && source ~/.bashrc` +1. again, press `esc` to enter command mode, then type `:wq` and press enter to save and exit. +1. create the `.bash_aliases` file with the following command: `touch ~/.bash_aliases` +1. open the file with vi: `vi ~/.bash_aliases` +1. press `I` to enter insert mode, and paste in the large block of text below. +1. save and exit, ` :wq ` +1. finally, type `source .bash_profile` to load all the aliases. +1. confirm the aliases load when you start a terminal by exiting your terminal and restarting. Type `alias` and press enter, and you should see the list below. ``` bash # @@ -44,3 +53,7 @@ alias edbash='vi ~/.bashrc' alias edal='vi ~/.bash_aliases' alias newdot='source ~/.bashrc' ``` + + +##### footnotes +1. `touch` is a utility that creates a file if it doesn't exist. diff --git a/resources/vi_cheat_sheet.md b/resources/vi_cheat_sheet.md index ccb0372..a56d1fa 100644 --- a/resources/vi_cheat_sheet.md +++ b/resources/vi_cheat_sheet.md @@ -5,33 +5,41 @@ There are two modes in vi. When you start the program, it will begin in command mode. ##### common commands to switch between modes -cmd | description --|- -i | insert mode right at cursor -I | insert mode at beginning of line -a | insert mode after cursor -A | insert mode at end of line -o | creates new line below cursor, begins input mode at beginning of line -O | creates new line above cursor, begins input mode at beginning of line -ESC | exits input mode, returns to command mode +| cmd | description | +|---|---| +| i | insert mode right at cursor | +| I | insert mode at beginning of line | +| a | insert mode after cursor | +| A | insert mode at end of line | +| o | creates new line below cursor, begins input mode at beginning of line | +| O | creates new line above cursor, begins input mode at beginning of line | +| ESC | exits input mode, returns to command mode | -##### common commands in command mode +##### how to quit vi +| cmd | description | +|---|---| +| :q | quit without saving | +| :w | write changes without exiting | +| :wq, :x, ZZ | write changes and quit | -cmd | description --|- -arrow keys | move cursor around the file -h,j,k,l | move cursor left, down, up, right, respectively -*n*G | move to line *n*. ex: 1G moves to beginning of file -G | without a number, G moves to end of file -0 (zero) | move to beginning of line -$ | move to end of line -w, b | move forward or backward by word +##### common commands in command mode -##### how to quit vi -cmd | description --|- -:q | quit without saving -:w | write changes without exiting -:wq, :x, ZZ | write changes and quit +| cmd | description | +|---|---| +| arrow keys | move cursor around the file | +| h,j,k,l | move cursor left, down, up, right, respectively | +| *n*G | move to line *n*. ex: 12G moves to line 12 of file | +| G | without a number, G moves to end of file | +| 0 (zero) | move to beginning of line | +| $ | move to end of line | +| w, b | move forward or backward by word | +| {, } | move forward or backward by paragraph | +| /word | find the next occurence of `word` | +| ?word | find the previous occurence of `word` | +| n | continue to the next occurence of the previous search | +| d | delete command. requires additional information | +| dw | deletes a word | +| dd | deletes the current line | +| d3G | deletes all text from current cursor to line 3 | Note that in many cases, there are a number of commands that do the same thing. diff --git a/resources/vi_practice.txt b/resources/vi_practice.txt deleted file mode 100644 index 3a8eaf9..0000000 --- a/resources/vi_practice.txt +++ /dev/null @@ -1,32 +0,0 @@ -Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc fermentum, sapien a finibus interdum, tortor odio -varius ex, non fringilla velit felis ut mi. Nunc vel neque eros. Morbi eu posuere tellus. -Ut ultrices elit malesuada tellus rhoncus sollicitudin. Duis gravida risus sagittis, hendrerit felis a, semper lectus. -Nullam varius, sapien nec dictum vulputate, justo nibh pulvinar elit, eu volutpat sapien ligula sit amet arcu. -Aenean dictum pellentesque risus, gravida ornare arcu rutrum ut. In dignissim maximus libero, eu sodales risus condimentum -facilisis. Proin volutpat orci mi. Sed bibendum at leo eu ornare. In iaculis eu ligula nec condimentum. - -Quisque sem lacus, pulvinar sed lectus ut, aliquam consectetur nisi. Fusce consectetur iaculis varius. Suspendisse blandit -odio at facilisis pulvinar. Nunc eu venenatis velit, pellentesque gravida lacus. Cras mauris ante, eleifend quis -elit vel, ultrices ultricies ex. Sed placerat orci nunc, in consequat ex placerat vitae. Nulla nec -lobortis erat. Integer at metus felis. Fusce commodo hendrerit velit vel interdum. Fusce tristique magna orci, -id venenatis quam commodo ut. - -Donec ut eros condimentum, venenatis diam a, interdum nisi. Quisque dapibus hendrerit urna, et condimentum urna. -Nam convallis ornare suscipit. Nulla auctor euismod urna, sed condimentum turpis volutpat vitae. Fusce sagittis fermentum -dolor dignissim egestas. Vivamus imperdiet congue interdum. In sed sollicitudin lectus. In dignissim quam eu dui commodo, -non ornare sem euismod. - -Ut vehicula massa quis purus hendrerit, ut vestibulum tortor lacinia. Proin laoreet lacus a venenatis porttitor. Praesent -sed odio nec lorem egestas posuere vel a arcu. Integer vel dolor ut ante pellentesque tincidunt ut eu quam. -Nam maximus ligula sed diam sollicitudin, sit amet sollicitudin lacus convallis. Morbi finibus mauris erat, quis -feugiat nibh ultricies ut. In tristique dignissim dui ac euismod. Aliquam erat volutpat. Cras lobortis sapien vel -risus scelerisque, at vestibulum dui porta. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per -inceptos himenaeos. In imperdiet purus non ante rutrum malesuada. Suspendisse aliquet placerat erat eu vehicula. - -Phasellus tristique, nulla at consequat luctus, ipsum nulla bibendum neque, ac ullamcorper erat erat et sapien. -Maecenas lobortis convallis enim consectetur dignissim. Maecenas sit amet nisi ac eros congue molestie. Sed at enim mauris. -Fusce fermentum elementum consectetur. Etiam rutrum neque vel ante tristique vehicula. Etiam at tortor felis. Aenean -dui enim, viverra eget metus vitae, convallis fringilla massa. Donec nec varius odio, fringilla laoreet tellus. In -viverra luctus hendrerit. Sed maximus urna massa, quis porttitor urna fringilla et. Aenean posuere et -nibh nec molestie. Vivamus libero metus, mollis at tincidunt eu, eleifend tempor ligula. Integer dignissim sodales -ante vitae fermentum. diff --git a/schedule/friday.md b/schedule/friday.md index f144459..89dc87b 100644 --- a/schedule/friday.md +++ b/schedule/friday.md @@ -2,23 +2,22 @@ * 6:00pm - Git: Merge Conflicts * Did you push your code last night? - * Branch: git checkout -b feature/friday + * Branch: git checkout -b friday * Add a new file: friday.md * MERGE CONFLICTS!!!! - * Modify line 1 of README.md in feature/friday + * Modify line 1 of README.md in friday * Commit changes; checkout master; modify line 1 of README.md in master * Look at history in master: * git log * git show [SHA] - * Look at history in feature/friday: - * git checkout feature/friday + * Look at history in friday: + * git checkout friday * git log * git show [SHA] - * Merge feature/friday into master and look at merge conflict + * Merge friday into master and look at merge conflict * How to resolve a merge conflict * 6:30pm - JavaScript: Functions & console.log * Use [code/friday.html](/code/friday.html) and [code/friday.js](/code/friday.js) - * Want to play with other forms of functions? Check out this [gist on the evolution of an IIFE](https://gist.github.com/bethadele/85621c52d9c454fdd258ec67e4279ea2) * 7:15pm - Prework (you should be 100% complete by the end of class) * 8:30pm - Recap, Q&A diff --git a/schedule/monday.md b/schedule/monday.md index 048e33f..265040a 100644 --- a/schedule/monday.md +++ b/schedule/monday.md @@ -1,24 +1,34 @@ # Monday * 6:00pm - Intro -* 6:30pm - Git: Basic Workflow +* 6:20pm - Git: Basic Workflow * Fork & clone * At the main class repo page on GitHub, click on the **Fork** link at top right * Fork to your personal GitHub account * On your fork's page, copy the repo URL (it should look like *yourusername/code102.git* instead of *FundamentalsOfCode/code102.git*) * In your terminal, navigate to a suitable location to clone this repo and clone with `git clone [url]` - * Create a new file for your class notes: notes/monday.md - * Add to your repo *before* you add any content: + * Use `ls` to check that git created a new directory with the same name as the repo + * Change into the new directory with the command `cd code102` + * What's the difference between the directory called `code102` and the repository called `code102`? + * In your repo's directory, create a new file for your class notes: notes/monday.md + * You can create an empty file with `touch notes/monday.md` + * ...or you can create the file in your text editor + * Add the new file to your repo *before* you add any content: * `git add notes/monday.md` * `git commit -m "Add notes file for Monday"` * Take notes on what you learn today in this markdown file -* 7:00pm - Developer Tools: Setting up Atom -* 7:15pm - Command Line: Aliases -* 8:15pm - Prework (you should be at least 20% complete by the end of class) -* 8:50 - Git +* 7:00pm - Developer Tools + * You need to develop a relationship with your text editor ([VS Code](https://code.visualstudio.com/docs/introvideos/basics), [Atom](http://flight-manual.atom.io/getting-started/sections/atom-basics/) [2](/resources/atom.md), [Sublime](http://docs.sublimetext.info/en/latest/basic_concepts.html), etc.). Spend the time to get to know it, and to customize it to make your workflow easier and more productive. + * Learn keyboard shortcuts (see links on [main page](/)). If your laptop allows multiple workspaces, learn how to use them. + * Learn how to type. If you can't type quickly and accurately, you'll be at a severe disadvantage. (A fantastic resource is [typing.io](https://typing.io).) +* 7:15pm - Prework (you should be at least 20% complete by the end of class) +* 8:30pm - Git + * Did you add your new `notes/monday.md` file to the repo earlier? How can you check? * Practice your git workflow: - * `git add -p` - * `git commit -m "Add good commit message"` - * `git push origin master` + * `git status` (to make sure you have changes to the repo) + * `git add -p` (to "stage" the changes) + * `git status` (this time, to check that everything has been staged) + * `git commit -m "Add good commit message"` (to "take the snapshot") + * `git push origin master` (to share the changes with your remote repo) [Back to main README](/README.md) | [Tuesday](/schedule/tuesday.md) diff --git a/schedule/r b/schedule/r new file mode 100644 index 0000000..e69de29 diff --git a/schedule/thursday.md b/schedule/thursday.md index 844348c..844176e 100644 --- a/schedule/thursday.md +++ b/schedule/thursday.md @@ -1,9 +1,9 @@ # Thursday * 6:00pm - Git: Pull Request Prep - * Create a `feature/thursday` branch + * Create a `thursday` branch * Tonight we're going to do things a little bit differently - * Create a notes/thursday-yourgitusername.md file and add it to the repo (e.g. `notes/thursday-bethadele.md`) + * Create a `notes/thursday-your-name.md` file and add it to the repo (e.g. `notes/thursday-beth.md`) * Take notes in this file through the evening * 6:10pm - JavaScript: Control Flow & Chrome Browser Tools * Use [code/thursday.html](/code/thursday.html) and [code/thursday.js](/code/thursday.js) @@ -13,7 +13,7 @@ * Push your work to your repo (`git push origin feature/thursday`) * Now do a pull request from your repo's "Pull Request" page to the master branch of one of your classmate's repos * By the end of the evening, everyone should have made a pull request **and** responded to a pull request - * Note that if you make changes in your branch and push before the pull request is accepted or closed, the pull request updates automagically -* 8:30pm - Recap, Q&A + * Note that if you make changes in your branch (locally) and push (to your remote) before the pull request is accepted or closed, the pull request updates automagically +* 8:45pm - Recap, Q&A [Back to main README](/README.md) | [Friday](/schedule/friday.md) diff --git a/schedule/tuesday.md b/schedule/tuesday.md index fa793f9..b5ab400 100644 --- a/schedule/tuesday.md +++ b/schedule/tuesday.md @@ -3,7 +3,7 @@ * 6:00pm - Git: Branching * Did you push your code last night? * Create a new branch: - * `git checkout -b feature/tuesday` + * `git checkout -b tuesday` * Add a new file: notes/tuesday.md * Create the file in Atom, or from the command line with `touch notes/tuesday.md` * Add to your repo *before* you add any content: @@ -12,20 +12,29 @@ * What happens if you check out master (`git checkout master`)? Is the new file there? * At the end of night we'll merge the new feature branch back into master * Make sure you check out the new branch (`git checkout feature/tuesday`) before continuing -* 6:15pm - JavaScript: Variables +* 6:15pm - Working at the Command Line + * Navigating at the command line + * `cd` = Change Directory (combine with `~`, `..`) + * `ls` = LiSt resources (combine with flags like `-l`, `-a`, `-la`) + * `pwd` = Present Working Directory + * `cp` = CoPy resource + * `mv` = MoVe resource (be careful with this one) + * `rm` = ReMove resource (be very, VERY careful with this one!) + * Bonus round 1: [Quick Intro to vi](/resources/vi_cheat_sheet.md) + * Bonus round 2: [Bash Aliases](/resources/bash_aliases.md) +* 6:45pm - JavaScript: Syntax & Variables * Use [code/tuesday.html](/code/tuesday.html) and [code/tuesday.js](/code/tuesday.js) -* 6:30pm - JavaScript: Syntax -* 7:00pm - Command Line: SSH Keys -* 7:30pm - Prework (you should be at least 40% complete by the end of class) + * Open the HTML file in your browser and use the browser tools (Cmd-Opt-I / Ctrl-Shift-I) to interact with your script using the JavaScript console +* 7:15pm - Prework (you should be at least 40% complete by the end of class) * 8:30pm - Git: Merging Branches * Commit your changes: * `git add -p` * `git commit -m "Add Tuesday notes"` * Merge the feature branch into master: * `git checkout master` - * `git merge feature/tuesday` + * `git merge tuesday` * Push your changes: * `git push origin master` (now you understand what `master` means... tomorrow you'll understand `origin`) -* 8:40pm - Recap, Q&A +* 8:50pm - Recap, Q&A [Back to main README](/README.md) | [Wednesday](/schedule/wednesday.md) diff --git a/schedule/wednesday.md b/schedule/wednesday.md index 4d0abb7..ad538b9 100644 --- a/schedule/wednesday.md +++ b/schedule/wednesday.md @@ -12,11 +12,12 @@ * Now you can fetch (or pull) from the original repo using `git fetch upstream` (or `git pull upstream`) * Maybe your instructor will commit a small change so you can see this in action... * Let's branch in this repo: - * `git checkout -b feature/wednesday` + * `git checkout -b wednesday` * Add a new file: `touch notes/wednesday.md` * For bonus points, experiment with [markdown styling](https://guides.github.com/features/mastering-markdown/) -* 6:30pm - Command Line: vi and Editing from the Command Line * 7:00pm - Prework (you should be at least 60% complete by the end of class) -* 8:30pm - Recap, Q&A + * Optional Command Line Bonus: [SSH Keys for Git](https://help.github.com/articles/connecting-to-github-with-ssh/) + * Optional JavaScript Bonus: [The Evolution of an IIFE](https://gist.github.com/bethadele/85621c52d9c454fdd258ec67e4279ea2) +* 8:45pm - Recap, Q&A [Back to main README](/README.md) | [Thursday](/schedule/thursday.md) diff --git a/test.js b/test.js new file mode 100644 index 0000000..a1cb24e --- /dev/null +++ b/test.js @@ -0,0 +1,17 @@ +var addNumbers = function(a, b) { + return a + b; +}; + +addNumbers(2, 5); +// return 7 + +addNumbers(50, 20); +// return 70 +// +// + +1 + 1; + +function () { + return a + b; +}();