Real unit test (isolation, no children render)
Calls:
- constructor
- render
| // Reference: http://www.blackdogfoundry.com/blog/moving-repository-from-bitbucket-to-github/ | |
| // See also: http://www.paulund.co.uk/change-url-of-git-repository | |
| $ cd $HOME/Code/repo-directory | |
| $ git remote rename origin bitbucket | |
| $ git remote add origin https://github.com/mandiwise/awesome-new-repo.git | |
| $ git push origin master | |
| $ git remote rm bitbucket |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| // Bonfire: Sum All Numbers in a Range | |
| // Author: @rahul1992 | |
| // Challenge: http://www.freecodecamp.com/challenges/bonfire-sum-all-numbers-in-a-range?solution=function%20sumAll(arr)%20%7B%0A%20%20var%20max%20%3D%20Math.max(...arr)%3B%0A%20%20var%20min%20%3D%20Math.min(...arr)%3B%0A%20%20%2F%2F%20The%20formulate%20to%20sum%20a%20series%20of%20integers%20is%0A%20%20%2F%2F%20n%20%3D%20(max-min)%2B1%0A%20%20%20%20%2F%2F%20n%20*%20(max%20-%20min%20%2F%202)%2C%20where%20n%20is%20the%20length%20of%20the%20series.%0A%20%20%20return%20((max-min)%2B1)%20*%20(min%20%2B%20max)%20%2F%202%3B%0A%7D%0A%0AsumAll(%5B4%2C%2010%5D)%3B%0A | |
| // Learn to Code at Free Code Camp (www.freecodecamp.com) | |
| function sumAll(arr) { | |
| var max = Math.max(...arr); | |
| var min = Math.min(...arr); | |
| // The formulate to sum a series of integers is | |
| // n = (max-min)+1 |
| // Bonfire: Diff Two Arrays | |
| // Author: @rahul1992 | |
| // Challenge: http://www.freecodecamp.com/challenges/bonfire-diff-two-arrays?solution=function%20diff(arr1%2C%20arr2)%20%7B%0A%20%20var%20newArr%20%3D%20arr1.concat(arr2)%3B%0A%20%20function%20found(item)%7B%0A%20%20%20%20if(arr1.indexOf(item)%20%3D%3D%3D%20-1%20%7C%7C%20arr2.indexOf(item)%20%3D%3D%3D%20-1)%7B%0A%20%20%20%20%20%20return%20item%3B%0A%20%20%20%20%7D%0A%20%20%7D%0A%20%20return%20newArr.filter(found)%3B%0A%7D%0A%0Adiff(%5B1%2C%202%2C%203%2C%205%5D%2C%20%5B1%2C%202%2C%203%2C%204%2C%205%5D)%3B%0A | |
| // Learn to Code at Free Code Camp (www.freecodecamp.com) | |
| function diff(arr1, arr2) { | |
| var newArr = arr1.concat(arr2); | |
| function found(item){ | |
| if(arr1.indexOf(item) === -1 || arr2.indexOf(item) === -1){ | |
| return item; |