Skip to content

Instantly share code, notes, and snippets.

Avatar
🤠
It’s happening

Joe Vu homeslicesolutions

🤠
It’s happening
View GitHub Profile
@homeslicesolutions
homeslicesolutions / sticky-container-custom-tag.js
Last active Dec 6, 2016
Stick Container with a Custom Tag
View sticky-container-custom-tag.js
import React from "react";
import {StickyContainer} from "react-sticky";
class StickyContainerCustomTag extends StickyContainer {
render() {
const tagName = this.props.tagName || 'div';
const props = {...this.props};
delete props.tagName;
@homeslicesolutions
homeslicesolutions / lodash_to_native.js
Last active May 19, 2020
Underscore/lodash => native
View lodash_to_native.js
const _ = require('lodash');
// COLLECTIONS
// _.each => Array.prototype.forEach
// _.map => Array.prototype.map
// _.reduce => Array.prototype.reduce
// _.reduceRight => Array.prototype.reduceRight
// _.find => Array.prototype.find
// _.filter => Array.prototype.filter
View Object Flatten
var flattenObject = function(ob) {
var toReturn = {};
for (var i in ob) {
if (!ob.hasOwnProperty(i)) continue;
if ((typeof ob[i]) == 'object') {
var flatObject = flattenObject(ob[i]);
for (var x in flatObject) {
if (!flatObject.hasOwnProperty(x)) continue;
You can’t perform that action at this time.