Skip to content

Instantly share code, notes, and snippets.

View gillesdemey's full-sized avatar
♥️
Be kind to others

Gilles De Mey gillesdemey

♥️
Be kind to others
View GitHub Profile
{
"name": "my-awesome-app",
"jest": {
"snapshotSerializers": [
"jest-snapshots-json-rest-api"
]
}
}
import React, { Fragment, useState } from 'react'
import Button from '../button/button'
function Counter (props) {
const [count, setCount] = useState(props.initialCount)
function increment () {
setCount(count + 1)
}
@gillesdemey
gillesdemey / README.md
Last active February 11, 2019 14:58
Collector Compose

Collector Compose

Prerequisites

⚠️ Make sure you have hoard-compose running ⚠️

This application will join the docker network created by hoard-compose, or manually create it using docker network create waylay.

Start application

const a = [1, 2, 3]
const b = [1, 1, 3]
const c = [3, 2, 1]
function verticalSum (...args) {
return args.reduce((acc, a) => acc.map((n, i) => n + a[i]), new Array(args.length).fill(0))
}
const result = verticalSum(a, b, c)
console.log(result)
package main
import (
"fmt"
"gonum.org/v1/gonum/graph"
"gonum.org/v1/gonum/graph/simple"
"gonum.org/v1/gonum/graph/traverse"
)
// GraphNode is a node in the DAG
package main
import (
"github.com/hashicorp/serf/serf"
"log"
"os"
"os/signal"
"syscall"
)
# also copies over metadata like album art
for i in *.flac; do echo $i; ffmpeg -i "$i" -y -v 0 -vcodec copy -acodec alac "${i%.flac}".m4a && rm -f "$i"; done
package main
import (
"fmt"
"golang.org/x/sync/errgroup"
"time"
)
func main() {
fmt.Println("Hello, world!")
package main
import (
"context"
"github.com/oklog/run"
"log"
"syscall"
"time"
)
@gillesdemey
gillesdemey / index.mjs
Last active June 27, 2021 16:55
Simple graph + walker
import graphlib from 'graphlib'
import { Walker } from './walk.mjs'
const { Graph, json } = graphlib
const graph = new Graph({ directed: true })
/* ┌───┐
* ┌▶│ 5 │───┐
* ┌───┐ ┌───┐ │ └───┘ │ ┌───┐