Skip to content

Instantly share code, notes, and snippets.

View Adesh's full-sized avatar
:octocat:
May the force be with code!

Adesh Shah Adesh

:octocat:
May the force be with code!
  • MS (CS), Research Student
  • Post graduate & Research Center, Nirma University
  • LinkedIn in/AdeshShah
View GitHub Profile
const redux = reuire('redux');
const createStore = redux.createStore;
const = initialState = {
counter: 0
};
// Reducer
const rootReducer = (state = initialState, action) => {
var request = require('request');
var path = require('path');
const BASEURL = process.env.BASEURL || '';
const ACCESSTOKEN = process.env.ACCESSTOKEN || '';
const HEADERS = {
'User-Agent': 'Super Agent/0.0.1',
'Authorization': 'Bearer ' + ACCESSTOKEN,
'Content-Type': 'application/json',
module.exports = randSplit;
function randSplit(_ary, _percentageSplit) {
// make sure the params are arrays
if(!Array.isArray(_ary) || !Array.isArray(_percentageSplit)) {
console.log(`Both arguments must be of array type`);
return false;
}