Skip to content

Instantly share code, notes, and snippets.

View sa-adebayo's full-sized avatar
🏠
Working from home

Adebayo Akinlaja sa-adebayo

🏠
Working from home
  • Japan
View GitHub Profile
@sa-adebayo
sa-adebayo / Immutable Proxy Hack (Javascript)
Last active May 14, 2018 17:22
Proxy that makes immutable object accessible via dot-notation (hack!)
const Immutable = require('immutable');
const immutableProfile = Immutable.fromJS({
data: [
{
name: 'Adebayo Akinlaja',
gender: 'Male',
properties: {
eyeColor: 'Blue',
@sa-adebayo
sa-adebayo / flattenArray
Created December 14, 2017 16:15
A JS function to recursively flatten an array
/**
* deeply flattens the content of an array recursively
* @param {Array} arr - the array to flatten
* @param {Array} acc - the accumulator array object
*/
function DeepFlatten(arr, acc) {
if (!(arr instanceof Array)) return acc.push(arr);
arr.forEach((value) => DeepFlatten(value, acc));
return acc;
}
@sa-adebayo
sa-adebayo / .eslintrc.json
Created August 14, 2017 14:29
andela - .eslintrc file
{
"extends": [
"airbnb",
"eslint:recommended",
"plugin:import/errors",
"plugin:import/warnings"
],
"plugins": [
"react"
],