Skip to content

Instantly share code, notes, and snippets.

View acwhittam's full-sized avatar

andy whittam acwhittam

View GitHub Profile
@acwhittam
acwhittam / fetch.js
Created September 6, 2021 16:15
node fetch future
const R = require('ramda');
const {
Future, resolve, reject,
} = require('fluture');
const fetch = require('node-fetch');
const { Request } = fetch;
const AbortController = require('abort-controller');
@acwhittam
acwhittam / flens.js
Created March 15, 2021 13:48
Playing with lens and futures
const R = require('ramda');
const {Future, isFuture, resolve, reject, after, both, fork } = require('fluture');
const sanctuary = require('sanctuary');
const {env:flutureEnv} = require('fluture-sanctuary-types');
const S = sanctuary.create ({checkTypes: false, env: sanctuary.env.concat (flutureEnv)})
const toFuture = R.unless(isFuture, S.of(Future));
const getter = (l) => (data) => (R.compose(
R.chain((value)=>R.isNil(value) ? reject(data) : resolve(value)),
@acwhittam
acwhittam / eav.js
Last active November 3, 2020 14:05
let counter = 1;
const db = [];
const entityIndex = new Map();
const valueIndex = new Map();
const attributeIndex = new Map();
const add = (obj) => {
const op = true;
const tx = new Date().getTime();

Keybase proof

I hereby claim:

  • I am acwhittam on github.
  • I am whittam (https://keybase.io/whittam) on keybase.
  • I have a public key whose fingerprint is 5DB4 C91E EDE8 1DA9 950A 89FA A7E1 7EC4 031E 1E34

To claim this, I am signing this object:

var R = require('ramda');
var currify = function (obj) {
var newObj = R.clone(obj);
var keys = R.keys(newObj);
R.forEach(function (key) {
if (typeof newObj[key], 'function') {
var func = newObj[key];
var curry = R.curry(func);
newObj[key] = curry;
var gulp = require('gulp'),
gutil = require('gulp-util'),
stylus = require('gulp-stylus'),
jade = require('gulp-jade'),
concat = require('gulp-concat'),
livereload = require('gulp-livereload'),
replace = require('gulp-replace');
// --- Basic Tasks ---