-
Install the React Developer Tools Chrome Extension.
-
Go to the egghead website, i.e. Getting Started with Redux
-
Click
View -> Developer -> Javascript Console
, then theReact
tab, then the<NextUpLessonList ...>
tag. -
Click back to the
Console
tab, then run:
// Bonfire: Repeat a string repeat a string | |
// Author: @twhite96 | |
// Challenge: http://www.freecodecamp.com/challenges/bonfire-repeat-a-string-repeat-a-string?solution=function%20repeat(str%2C%20num)%20%7B%0A%20%20%2F%2F%20repeat%20after%20me%0A%20%20var%20newString%20%3D%20%22%22%3B%0A%20%20while%20(num%20%3E%200)%20%7B%0A%20%20%20%20newString%20%2B%3D%20str%3B%0A%20%20%20%20num--%3B%0A%20%20%7D%0A%20%20return%20newString%3B%0A%7D%0A%0Arepeat(%22abc%22%2C%203)%3B%0A | |
// Learn to Code at Free Code Camp (www.freecodecamp.com) | |
function repeat(str, num) { | |
// repeat after me | |
var newString = ""; | |
while (num > 0) { | |
newString += str; |
/* | |
Traffic Light Demo | |
*/ | |
bool testMode = false; | |
// First light | |
int firstLightGreen = 3; | |
int firstLightYellow = 4; | |
int firstLightRed = 5; |
//Create Questions | |
var questions = [ | |
new Question("Who was the first President of the United States?", [ "George Washington", "Thomas Jefferson" ], "George Washington"), | |
new Question("What is the answer to the Ultimate Question of Life, the Universe, and Everything?", ["Pi","42"], "42") | |
]; | |
//Create Quiz | |
var quiz = new Quiz(questions); | |
//Display Quiz |
function chunkArrayInGroups(arr, size) { | |
var newArray = []; | |
var oldArray = arr.length/size; | |
for (var i = 0; i < oldArray; i++) { | |
var array = arr.splice(0, size); | |
newArray.push(array); | |
} | |
return newArray; | |
function slasher(arr, howMany) { | |
// it doesn't always pay to be first | |
arr.splice(0, howMany); | |
return arr; | |
} | |
slasher(["burgers", "fries", "shake"], 1); |
function mutation(arr) { | |
var arr1 = arr[1].toLowerCase(); | |
var arr2 = arr[0].toLowerCase(); | |
for (var i = 0; i < arr1.length; i++) { | |
if (arr2.indexOf(arr1[i]) < 0) | |
return false; | |
} | |
return true; |
import urllib2 | |
resp = urllib2.urlopen('http://testurl.com') | |
from bs4 import BeautifulSoup | |
soup = BeautifulSoup(resp.read()) | |
links = soup.find_all('a') | |
foreach links in link: |
import urllib2 | |
resp = urllib2.urlopen('http://testurl.com') | |
from bs4 import BeautifulSoup | |
soup = BeautifulSoup(resp.read()) | |
images = soup.find_all('img') | |
foreach images in image: |
This is the style guide that you will be required to follow for any and all code submissions in this class. There is a very good chance that, should you decide to venture out into the wild and develop software professionally, you will be required to follow some sort of coding standard. All submissions must adhere to this style guide, if they don't there will be penalties up to and including the submission not being accepted or cosidered for a grade. You're in luck though, as this is a relatively easy style guide to follow. Suggestions are always welcome and above all else, even if you hate style guides and vow solemnly never to follow one again in your whole life...just make sure your code is consistent. Your future self will thank you. On a side note, it will be relatively apparent to me if you don't follow the style guide.
If changes are made to this guide throughout the semester, I will be sure to let you know and discuss the change with you.