Skip to content

Instantly share code, notes, and snippets.

View nicolasbrugneaux's full-sized avatar
🤓
Nerdin'

Nicolas Brugneaux nicolasbrugneaux

🤓
Nerdin'
View GitHub Profile
@nicolasbrugneaux
nicolasbrugneaux / migrate.js
Created March 30, 2016 09:53
true parallelism in node
import { cpus } from 'os';
import cluster from 'cluster';
if (cluster.isMaster) {
getAllRows()
.then(rows => {
const CPUS = cpus().length;
const chunked =chunks(rows, CPUS); // n rows into an array of length CPUS containing n/CPUS-ish rows (tries to balance)
const statuses = chunked
@nicolasbrugneaux
nicolasbrugneaux / plv8.rb
Last active March 21, 2017 11:47 — forked from aliatsis/plv8.rb
brew plv8 formula (static linking to v8)
require 'formula'
# based on https://github.com/Homebrew/homebrew/pull/19833
class Plv8 < Formula
homepage 'http://code.google.com/p/plv8js/wiki/PLV8'
version '2.0.0'
url 'https://github.com/plv8/plv8/archive/master.zip'
depends_on :postgresql
const fetch = require('node-fetch');
const API_URL = 'https://slack.com/api/';
const TOKEN = '?token=' + 'redacted';
const DEFAULT_COUNT = 100; // as per slack's doc
const PAST_THRESHHOLD = new Date();
PAST_THRESHHOLD.setHours(-120 * 24, 0, 0, 0);

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@nicolasbrugneaux
nicolasbrugneaux / settings.json
Created September 4, 2020 21:07
vscode settings
// Place your settings in this file to overwrite the default settings
{
"editor.glyphMargin": false,
"editor.wordWrap": "off",
"workbench.colorCustomizations": {
"editorIndentGuide.activeBackground": "#888",
},
"editor.codeActionsOnSave": {
"source.organizeImports": false,
"source.fixAll.eslint": true