Skip to content

Instantly share code, notes, and snippets.

View RahulReddy75's full-sized avatar

Rahul RahulReddy75

View GitHub Profile
@siddharthkp
siddharthkp / reactivconf-2017-proposal.md
Last active February 25, 2024 10:06
Building applications for the next billion users
@fokusferit
fokusferit / enzyme_render_diffs.md
Last active September 19, 2025 19:40
Difference between Shallow, Mount and render of Enzyme

Shallow

Real unit test (isolation, no children render)

Simple shallow

Calls:

  • constructor
  • render

[based on a true story]

So. Your friend's about to teach you how to make a website. Great!

You make a file, and you save it as 'index.html'. Why it's called 'index' isn't really explained to you, but whatever.

You type the following.

hello world
// 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;
// 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
@mandiwise
mandiwise / Update remote repo
Last active August 20, 2025 13:39
Transfer repo from Bitbucket to Github
// 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
@willurd
willurd / web-servers.md
Last active October 30, 2025 23:18
Big list of http static server one-liners

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.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@dwayne
dwayne / a-modern-frontend-dev.md
Last active March 21, 2021 11:38
Articles, tutorials and tools for modern front-end development.

Problem: What does a Modern Front-End Development Workflow Look Like?

I want to start writing libraries and large applications using the JavaScript language. However, I don't know how to setup the project and which build tools to use. What I do know is that the JavaScript community has moved way beyond using browser developer tool plugins and strategically-placed console.log() statements to debug, test, and build code.

I need help.

Below, I will keep track of articles, tutorials and tools I come across as I search for a way to bring my front-end development chops up-to-date.

The Ultimate Resource