Skip to content

Instantly share code, notes, and snippets.


Aymeric Beaumet aymericbeaumet

View GitHub Profile
aymericbeaumet /
Last active Jun 1, 2020
[Recipe] Create a local Postgres instance

I often want to start a local postgres instance within a foreground process using a data directory located in my project. I don't like relying on some system service. This is how I achieve this:

  1. Install Postgres (YMMV, I'm using Brew here):
brew reinstall postgres
  1. Initialize the Postgres cluster and update the .gitignore:
aymericbeaumet /
Last active Oct 29, 2020
[Recipe] Delete all your likes/favorites from Twitter

Ever wanted to delete all your likes/favorites from Twitter but only found broken/expensive tools? You are in the right place.

  1. Go to:{username}/likes
  2. Open the console and run the following JavaScript code:
setInterval(() => {
  for (const d of document.querySelectorAll('div[data-testid="unlike"]')) {
aymericbeaumet / express-static.js
Last active Sep 4, 2019
Basic implementation of, does not support any option.
View express-static.js
const express = require("express"); //
const fs = require("fs"); //
const path = require("path"); //
* This function exists for convenience only. It allows to create a new
* middleware with the given parameters (here we only expect a single one: the
* root directory). It mimics the genuine express.static function signature
* (modulo the options argument).
View useful-es6.js
import { EventEmitter } from 'events';
const number = 42;
export const say = (n = number) => `
My number is: ${n}
export default class extends EventEmitter {
constructor(name, {

Keybase proof

I hereby claim:

  • I am aymericbeaumet on github.
  • I am aymericbeaumet ( on keybase.
  • I have a public key whose fingerprint is 9979 A61B 3577 119F CAF0 5F84 98A8 7F81 DCF7 32EA

To claim this, I am signing this object:

// Send the key to
function generateKey() {
var input = document.querySelector('#user-input').value
if (input.length >= 10) {
document.querySelector('#result').textContent = hash(input)
function hash(payload) {
aymericbeaumet / .gitignore
Last active Aug 29, 2015
Benchmarking Array.prototype.indexOf and Object in operator
View .gitignore
aymericbeaumet / manifest.js
Last active Sep 28, 2015
Duo.js: manifest proposal
View manifest.js
// This file serves as a manifest, packages are required but not used
aymericbeaumet / french-saints.json
Last active Jun 28, 2020
List of French Saints. Useful for calendar applications. Format: { "month/day": "saint name" }
View french-saints.json
"01/01": "Jour de l'An",
"01/02": "Saint Basile",
"01/03": "Sainte Geneviève",
"01/04": "Saint Odilon",
"01/05": "Saint Edouard",
"01/06": "Saint André",
"01/07": "Saint Raymond",
"01/08": "Saint Lucien",
"01/09": "Sainte Alix",
You can’t perform that action at this time.