This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test/coverage/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Bob | |
def reply_to(statement) | |
public_send("reply_to_#{statement.class}".downcase.to_sym) | |
rescue NoMethodError | |
default_reply | |
end | |
def reply_to_silence | |
"Fine. Be that way!" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Bob | |
def respond_to(input) | |
@input = input.strip | |
return "Fine. Be that way!" if silence? | |
return "Whoa, chill out!" if shouting? | |
return "Sure." if question? | |
"Whatever." | |
end |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| NAME | PATH | HTTP VERB | PURPOSE | | |
|----------|----------------|-----------------|--------------------------------------| | |
| Index | /blog | GET | Displays all blog post | | |
| New | /blog/new | GET | Shows new form for new blog entry | | |
| Create | /blog | POST | Creates a new blog post | | |
| Show | /blog/:id | GET | Shows one specified blog post | | |
| Edit | /blog/:id/edit | GET | Shows edit form for one blog post | | |
| Update | /blog/:id | PUT | Updates a particular blog post | | |
| Destroy | /blog/:id | DELETE | Deletes a particular blog post | |
If you haven’t worked with JavaScript in the last few years, these three points should give you enough knowledge to feel comfortable reading the React documentation:
- We define variables with
let
andconst
statements. For the purposes of the React documentation, you can consider them equivalent tovar
. - We use the
class
keyword to define JavaScript classes. There are two things worth remembering about them. Firstly, unlike with objects, you don't need to put commas between class method definitions. Secondly, unlike many other languages with classes, in JavaScript the value ofthis
in a method [depends on how it is called](https://developer.mozilla.org/en-US/docs/Web/Jav
![cc.png](https://gist.github.com/ismith/d1b080c18e2de6d19075e6d02cd84291/raw/a2054d5522239e163dddc418be5bc3c89ea97574/cc.png)
In student projects, I commonly look at contribution graphs to see how much code they worked on, to get an idea if one student is doing more work than others on the project. This can be used for coaching and performance grading.
Start with your ~/.gitconfig
file in your home folder. Add these lines:
First, make sure you're at the home directory by typing cd
.
Next, type nano .bash_profile
. Copy and paste this into the window:
# get current branch in git repo
function parse_git_branch() {
BRANCH=`git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'`
if [ ! "${BRANCH}" == "" ]
then
OlderNewer