Skip to content

Instantly share code, notes, and snippets.

@anatomic
anatomic / machine.js
Last active January 19, 2021 22:04
Generated by XState Viz: https://xstate.js.org/viz
const formMachine = Machine({
id: "formMachine",
initial: "editing",
context: {
questions: [],
name: ""
},
states: {
editing: {
initial: "addOnly",
const puppeteer = require("puppeteer");
const readline = require("readline");
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
terminal: false
});
const eq = (a, b) => {
const API_BASE = "https://api.citybik.es";
const fetchP = require("node-fetch");
const {
Async,
pipeK,
propOr,
} = require("crocks");
const fetch = Async.fromPromise(fetchP);
// Needs to return the first repeated letter
// Points for reduced O complexity
// Challenge: Write a function that given a string, returns the first char that is repeated
// Example, the first letter to be repeated in this sentence is 't'
import {
safeLift,
isString,
head,
tail,
const Brakes = require('brakes');
const Async = require('crocks/Async');
const fetch = require('node-fetch');
const assoc = require('crocks/helpers/assoc');
const compose = require('crocks/helpers/compose');
const composeK = require('crocks/helpers/composeK');
const defaultTo = require('crocks/helpers/defaultTo');
const propOr = require('crocks/helpers/propOr');
const and = require('crocks/logic/and');
@anatomic
anatomic / wrapping-async.js
Created May 24, 2018 00:13
Circuit Breaking Async
// This little workaround allows us to have a fallback value if our remote service fails us
let lastKnownGood = {
count: 0,
fixtures: [],
};
const fetchJson = (url, options) => fetch(url, options).then(res => res.json());
const fetchm = nAry(2, Async.fromPromise(fetchJson));
const toDate = d => new Date(d);

Abstract Title

Breaking Out Of The Fear Cycle

Abstract Topic

  • Cautionary Tales

(I'm not sure which one applies the best here)

Submission Type

  • Keynote (40m)

Abstract Title

Production Ready Microservices Using Node.js

Abstract Topic

Applications

Submission Type

Hop Workshop (2hr)

Abstract Summary (up to 300 words)

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
.my-list {
padding: 0;
margin: 0;