Skip to content

Instantly share code, notes, and snippets.

View renatobenks-zz's full-sized avatar

Renato Benkendorf renatobenks-zz

View GitHub Profile
@renatobenks-zz
renatobenks-zz / keybase.md
Created December 18, 2018 13:52
keybase.md

Keybase proof

I hereby claim:

  • I am renatobenks on github.
  • I am renatobenks (https://keybase.io/renatobenks) on keybase.
  • I have a public key ASBI2LH7d-io18f6HxsSnBebghEvFtOb5YQcCp7-qrcoigo

To claim this, I am signing this object:

@renatobenks-zz
renatobenks-zz / compose.js
Created May 14, 2018 10:45
A compose function
function compose(...funcs) {
if (funcs.length === 0) return arg => arg;
if (funcs.length === 1) return funcs[0];
return funcs.reduce((a, b) => (...args) => a(b(...args)))
}
@renatobenks-zz
renatobenks-zz / normalize.js
Created May 12, 2018 10:46
A functional based normalize with legacy code written in Javascript totally typed-safe
// @flow
const FOLLOWING_ENUM = {
S: true,
N: false,
};
type FollowingEnum = $Values<typeof FOLLOWING_ENUM>;
const SANITIZED_KEYS = {
@renatobenks-zz
renatobenks-zz / binary_expression.js
Last active April 3, 2018 04:49
self-challenge
const removeDuplicateValues = values => values.filter((number, i, array) => array.indexOf(number) === i);
const getBinaryFromNumber = number => (number >>> 0).toString(2);
const getNumbers = numbers =>
numbers.map(number => ({
binary: getBinaryFromNumber(number),
value: number,
}));
@renatobenks-zz
renatobenks-zz / updateSchema.js
Created January 22, 2018 03:32
graphql-dataloader-boilerplate - Automating GraphQL processes on Javascript through of lint-staged
#!/usr/bin/env babel-node --optional es7.asyncFunctions
/**
* This file provided by Facebook is for non-commercial testing and evaluation
* purposes only. Facebook reserves all rights not expressly granted.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
@renatobenks-zz
renatobenks-zz / package.json
Last active January 22, 2018 03:28
graphql-dataloader-boilerplate - Automating GraphQL processes on Javascript through of lint-staged
{
"scripts": {
"update-schema": "babel-node ./scripts/updateSchema.js"
}
}