Skip to content

Instantly share code, notes, and snippets.

View sebabouche's full-sized avatar

Sébastien Nicolaïdis sebabouche

  • Sifnos.io
  • La Trinité sur Mer
View GitHub Profile
@sebabouche
sebabouche / machine.js
Last active April 7, 2021 06:53
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
// - XState (all XState exports)
@sebabouche
sebabouche / machine.js
Last active April 5, 2021 17:18
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
DKYMEJ88UQ9LB6HW6MDRR4PHJF6W74LCNRXK4VSXBC2K7PUJ7GN4CKCCDYV76DZ97HCXUJQ4FNBQ7LTADC8AZTT5VN4HPFP
@sebabouche
sebabouche / regex_samples.md
Last active September 20, 2018 11:27
Regex samples

select all lines from a word to another.

^ +word1(.|\n)*?word2\n

@sebabouche
sebabouche / index.html
Last active September 9, 2018 21:06
An RxJS 6 (6.2.1) bin / sandbox / playground
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="An RxJS 6.2.1 bin">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<button id="button">A button</button>
@sebabouche
sebabouche / ramda8.js
Created June 22, 2018 20:22
ramda: lens (lens, lensProp, lensPath, view, set, over)
import { lensProp, lensPath, view, set, over, toUpper } from "ramda"
const me = {
firstName: "Sébastien",
lastName: "Nicolaïdis",
birthDate: new Date("1979-09-13T15:00Z"),
age: 38,
hobbies: ["Rock climbing", "Horse riding", "Chess"],
parents: {
brother: {
@sebabouche
sebabouche / ramda7.js
Created June 22, 2018 20:21
ramda: arrays (nth, slice, contains, head, last, tail, init...)
import {
nth,
slice,
contains,
head,
last,
tail,
init,
length,
take,
@sebabouche
sebabouche / ramda6.js
Last active October 24, 2018 02:39
ramda: objects (compose, inc, prop, assoc, evolve, always, add)
import { compose, inc, prop, assoc, evolve, always, add } from "ramda"
const nextAge = compose(
inc,
prop("age"),
)
console.log("nextAge", nextAge({ age: 21 }))
const celebrateBirthday = person => assoc("age", nextAge(person), person)
const person = { age: 24 }
console.log("celebrateBirthday", celebrateBirthday(person))
@sebabouche
sebabouche / ramda5.js
Created June 22, 2018 20:19
ramda: assoc, assocPath, dissoc, dissocPath, omit, compose, inc, prop
import { assoc, assocPath, dissoc, dissocPath, omit, compose, inc, prop } from "ramda"
const original = {
a: "Bingo",
b: {
c: "Bingo",
d: "Bingo",
},
}
@sebabouche
sebabouche / ramda4.js
Created June 22, 2018 20:18
ramda: has, path, propOr, pathOr, keys, values
import { has, path, propOr, pathOr, keys, values } from "ramda"
const one = {
a: "Bingo",
b: {
c: "Bingo",
},
}
const two = {