Skip to content

Instantly share code, notes, and snippets.

View fernandocamargo's full-sized avatar
💀
I am the beast I worship

Fernando Camargo Del Buono fernandocamargo

💀
I am the beast I worship
View GitHub Profile
console.clear();
var sample = {
a: 'this is something',
b: {
c: {
d: {
e: 'this is something',
f: [
'this is something',
import React from 'react';
import IsometricGrid, { Cell } from 'react-isometric-grid';
import dynamics from 'dynamics.js';
const getRandomInt = (min, max) =>
Math.floor(Math.random() * (max - min + 1)) + min;
const properties = pos => ({
translateZ: (pos + 1) * 30,
rotateZ: getRandomInt(-4, 4),
<html>
<body>
<pre></pre>
<script>
const output = document.querySelector('pre');
const url = 'http://163.172.172.242:4242/challenge/survey';
const size = 100;
const initial = 1;
const indexes = {
records: [],
const convert = seconds => [36000, 3600, 600, 60, 10, 1].reduce(
({ seconds, label }, unit) => {
const difference = Math.floor(seconds / unit);
return {
seconds: seconds - (difference * unit),
label: label + difference
};
},
{ seconds, label: '' }
// https://jsfiddle.net/2we0rmox/
const clear = type => filter => filter.type !== type;
const add = filter => ({ filters }) => {
const current = filters.filter(clear(filter.type));
return {
filters: !filter.value ? current : current.concat(filter),
};
const test = [[1, [2, [3]]], 4];
const dig = (stack, object) =>
Array.isArray(object) ? flatten(object, stack) : stack.concat(object);
const flatten = (input, output = []) => input.reduce(dig, output);
console.clear();
console.log(flatten(test)); // [1, 2, 3, 4]
export const mock = () => ({
a: () => {},
b: () => {},
c: () => {},
d: {
e: {
f: () => {},
g: {
h: {
i: () => {}
<h1>Usage</h1>
<div id="docs">
<pre>
<code class="language-js">
&lt;Modal&gt;
{({ Container, Title, Content, Footer }) =&gt; (
&lt;Container&gt;
&lt;Title&gt;
&lt;marquee&gt;Hello, world!&lt;/marquee&gt;
import last from "lodash/last";
import React, { Fragment } from "react";
import { useSlot, useLog } from "nodh";
// your service (async operation)
const fetchGithubRepos = () =>
window
.fetch("https://api.github.com/search/repositories?q=react")
.then(response => response.json());
import React from "react";
import { Provider as Curse } from "nodh";
import YourApp from "./app";
// it works 👍
export default (
<Curse>
<YourApp />
</Curse>