Skip to content

Instantly share code, notes, and snippets.

View anandgupta193's full-sized avatar
🎯
Focusing

Anand Gupta anandgupta193

🎯
Focusing
View GitHub Profile
@abha57
abha57 / combineReducers polyfill
Last active September 23, 2020 04:09
combineReducers polyfill
const combineReducers = (reducers) => (state = {}, action) => Object.keys(reducers).reduce((nextState, key) => {
nextState[key] = reducers[key](state[key], action);
return nextState;
}, {});
1-In the github repo on Settings > Integration & Services, enable
2-Go to travisCI page and enable the repo
3-Configure the env variables on TravisCI so that it is not necessary to save credentials on github
-in the project Settings on TravisCI, add the entry for netlify site id: NETLIFY_SITE_ID - <site_id from .netlify file generated on netlify create>
-create a netlify access token for TravisCI
-On Netlify Dashboard, Go to Account Settings > OAuth Applications (https://app.netlify.com/account/applications) > Personal access tokens and press New Access Token
-Name it anything, but to make it easier the suggestion is name TravisCI.
-Generate it and COPY it - you won’t see it again!
-in the project Settings on TravisCI, add the entry for netlify personal access token generated for TravisCI: NETLIFY_ACCESS_TOKEN
4-Generate a .travis.yml file in the local repo
@Geoff-Ford
Geoff-Ford / master-javascript-interview.md
Last active November 21, 2025 01:12
Eric Elliott's Master the JavaScript Interview Series
@lahdo
lahdo / 1-one-row-expressions.js
Created March 22, 2017 10:33 — forked from olvnikon/1-one-row-expressions.js
Javascript tricky questions. Check yourself. Or destroy any interviewee.
// https://jsfiddle.net/vk35ok2o/50/
console.log('typeof 1/0 => ', typeof 1/0);
console.log('typeof (1/0) => ', typeof (1/0));
console.log('1/0 => ', 1/0);
console.log('"Hello" * 2 => ', "Hello" * 2);
console.log('typeof ("Hello" * 2) => ', typeof ("Hello" * 2));
console.log('typeof "Hello" * 2 => ', typeof "Hello" * 2);
console.log('typeof undefined => ', typeof undefined);
console.log('typeof null => ', typeof null);
console.log('typeof function(){} => ', typeof function(){});
@brianonn
brianonn / isArray.js
Created September 13, 2016 15:43
Array.isArray polyfill
if (!Array.isArray) {
Array.isArray = function(arg) {
return Object.prototype.toString.call(arg) === '[object Array]';
};
}

@kangax's ES6 quiz, explained

@kangax created a new interesting quiz, this time devoted to ES6 (aka ES2015). I found this quiz very interesting and quite hard (made myself 3 mistakes on first pass).

Here we go with the explanations:

Question 1:
(function(x, f = () =&gt; x) {