Skip to content

Instantly share code, notes, and snippets.

View inodaf's full-sized avatar
👨‍🚀
Starfleet Command

Isac Fadoni inodaf

👨‍🚀
Starfleet Command
  • Senior Software Engineer · @n26
  • Berlin, Germany
  • 06:13 (UTC +02:00)
View GitHub Profile
@inodaf
inodaf / deftest.js
Last active March 20, 2018 13:28
Testing Defy.js
defmodule('Contestation', ({ def, run, callbacks }) => {
const { Http } = Defy.Plugins
const storageURL = `${process.env.SANDFILE_URL}/document`
const graphQLURL = process.env.GRAPHQL_URL
def('post_document', doc => {
const requestPayload = {
query: mutationBuilder(doc, 'addDocument', 'errors { code path description } }')
}
@inodaf
inodaf / def.js
Last active March 6, 2018 22:15
Simple way to define your functional modules. Just for study purposes.
(function simpleFp() {
const Utils = {
getFunctionArity(fn) {
return fn.length
},
getFunctionModule(fnName, fnArity) {
const fnPath = fnName.split('.')
const isOuter = fnPath.length > 1
if (isOuter) {
@inodaf
inodaf / create-observable.js
Last active June 24, 2020 20:05
👀 Object Observable using ES6 Proxies.
function createObservable(observable, { onGet, onSet }) {
const interceptor = {
get(target, key, receiver) {
onGet(key)
return target[key]
},
set(target, prop, value) {
onSet(prop, value)
return true
}
@inodaf
inodaf / is-uri.js
Last active September 25, 2016 01:36
Check if a string is an URI.
;(function(obj) {
'use strict';
/*
* @name: isURL
* @description: Checks if a String is an URI
*
* @param String : The string to be checked
*/