Skip to content

Instantly share code, notes, and snippets.

View barodeur's full-sized avatar

Paul Chobert barodeur

View GitHub Profile
@barodeur
barodeur / keybase.md
Created February 17, 2022 19:03
keybase.md

Keybase proof

I hereby claim:

  • I am barodeur on github.
  • I am barodeur (https://keybase.io/barodeur) on keybase.
  • I have a public key ASDY1epvqCiVg_JQ5SLZAhVB7zz5kUUfTv0Z68Izmexwego

To claim this, I am signing this object:

@barodeur
barodeur / machine.js
Last active November 28, 2019 19:07
Generated by XState Viz: https://xstate.js.org/viz
const fetchMachine = Machine({
id: "dailyChallenge",
initial: "not_started",
context: {
remainingPrompts: 2
},
states: {
not_started: {
on: {
START: "playing"

Old version

00000000000000ab080200000157fd50ce080004a014771cf4da0b009c00
420b001ffd140a0101020003004501f00150051504c800fd01fe3608b500
11b6000a42389018001fcd60ebce3006431f8644000002c70000000ff100
0051410000000157fd50d60a0004a01d931cf4dd48009b003c0b0025fd14
0a0101020003004501f00150051504c800fd01fe3708b50011b6000a4238
8c180025cd60ebce3006431f8644000002c700000011f100005141000200
@barodeur
barodeur / ReduxBridgeAPI.md
Last active September 29, 2016 13:12
Redux Bridge example

Redux Bridge API

@barodeur
barodeur / uniqueToken.js
Created April 26, 2015 05:49
unique token generation example
// mock for collection.findOne
// the fourth call returns true the fifth returs false
var i = 0;
var isTokenInDB = function(token, callback) {
setTimeout(function() {
callback(null, (++i) < 5);
}, 200);
};
// generate random string

Keybase proof

I hereby claim:

  • I am barodeur on github.
  • I am barodeur (https://keybase.io/barodeur) on keybase.
  • I have a public key whose fingerprint is 22B6 C504 424A F3FC 6B2C FD43 8C96 ECA3 232E F929

To claim this, I am signing this object:

ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAwCKRkq5ID7bhVJkkOq100t7E0V6EnMhRg3Q9RvuxlbqCv7/I5yAEPqGnFtQbmS7ljsRVDzXV9+klYjvCPX/x+bD3dgc7T5h7oqB8xggJ70etr2Lma625tDn9RPzO8IUBOEnQRPDx5MQYTct3yxZt45mbOHYeBwnDUf4arvD79F8bSZMfDMOeLkyKiFzJEATM+W0GWwxC08IYhOAnXmhi5SdqeaLsh4xZdTC5+7Lh3hNrBIk8udgxRD065YovhZfvPyLWC4w7Usz7Tv6+YhPvexBT6TlCmTk413+MqsO4So9eSzwi9n0WUetHg7Au6awOuWz0U0pnfn0kiBfpXAelDQ== [email protected]
@barodeur
barodeur / main.c
Created March 19, 2013 12:32
libev example
#include <stdio.h>
#include <stdlib.h>
#include <netinet/in.h>
#include <ev.h>
#include <strings.h>
#define PORT_NO 3033
#define BUFFER_SIZE 1024
void accept_cb(struct ev_loop *loop, struct ev_io *watcher, int revents);
async = require 'async'
arr = [1, 2, 3, 4, 5, 6]
async.reduce(
[
(i, cb) -> cb(null, i * 2)
(i, cb) -> cb(null, i + 1)
]
(i, cb) -> cb(null, i)
#!/usr/bin/env bash
apt-get -y update
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline-dev libyaml-dev
cd /tmp
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p392.tar.gz
tar -xvzf ruby-1.9.3-p392.tar.gz
cd ruby-1.9.3-p392/
./configure --prefix=/usr/local
make
make install