-
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:
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
// Bonfire: Confirm the Ending | |
// Author: @twhite96 | |
// Challenge: http://www.freecodecamp.com/challenges/bonfire-confirm-the-ending?solution=function%20end(str%2C%20target)%20%7B%0A%20%20%2F%2F%20%22Never%20give%20up%20and%20good%20luck%20will%20find%20you.%22%0A%20%20%2F%2F%20--%20Falcor%0A%0A%20%0A%20%20var%20length%20%3D%20target.length%3B%0A%20%20var%20isEqual%20%3D%20target%20%3D%3D%3D%20str.substr(-length)%3B%0A%20%20%20return%20isEqual%3B%0A%20%20%20%0A%7D%0A%0Aend(%22Bastian%22%2C%20%22n%22)%3B%0A | |
// Learn to Code at Free Code Camp (www.freecodecamp.com) | |
function end(str, target) { | |
// "Never give up and good luck will find you." | |
// -- Falcor | |
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
// 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; |
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
/* | |
Traffic Light Demo | |
*/ | |
bool testMode = false; | |
// First light | |
int firstLightGreen = 3; | |
int firstLightYellow = 4; | |
int firstLightRed = 5; |
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
//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 |
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
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 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
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: |
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
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; | |
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
function slasher(arr, howMany) { | |
// it doesn't always pay to be first | |
arr.splice(0, howMany); | |
return arr; | |
} | |
slasher(["burgers", "fries", "shake"], 1); |
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
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; |