Skip to content

Instantly share code, notes, and snippets.

View mcollina's full-sized avatar

Matteo Collina mcollina

View GitHub Profile
@mcollina
mcollina / publish.sh
Created August 12, 2022 22:22
npm workspace publish
#!/bin/sh
VERSION=$1
MODULES=`node -e "console.log(require('./package.json').workspaces.join(' '))"`
for MODULE in $MODULES; do
echo "Building $MODULE"
pushd $MODULE
npm version $VERSION --save
NAME=`node -e "console.log(require('./package.json').name)"`
@mcollina
mcollina / settuning.sh
Last active April 16, 2024 17:12
m3medium config
#!/bin/bash
sysctl net.core.rmem_default=268435456
sysctl net.core.wmem_default=268435456
sysctl net.core.rmem_max=268435456
sysctl net.core.wmem_max=268435456
sysctl net.core.netdev_max_backlog=100000
sysctl "net.ipv4.tcp_rmem=4096 16384 134217728"
sysctl "net.ipv4.tcp_wmem=4096 16384 134217728"
sysctl "net.ipv4.tcp_mem=786432 1048576 268435456"
@mcollina
mcollina / .tmux.conf
Created August 7, 2023 16:08
My tmux.conf
# set-option -g default-command "reattach-to-user-namespace -l /bin/bash"
set -g default-terminal "screen-256color"
# Pane resizing
bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5
# splitting panes
@mcollina
mcollina / go.js
Created August 18, 2023 15:36 — forked from cjihrig/go.js
Parse Node Download Data
'use strict';
const assert = require('node:assert');
const fs = require('node:fs/promises');
const DATA_HOME_URL = 'https://storage.googleapis.com/access-logs-summaries-nodejs/index.html';
const DATA_FILE_PATH = 'data.json';
const DATA_CSV_PATH = 'data.csv';
const DATA_CSV_SEVEN_DAY_PATH = 'data-seven-day-avg.csv';
const LINES = ['14', '16', '18', '19', '20'];
async function main() {
@mcollina
mcollina / bio.md
Last active June 14, 2023 16:07
Speaking Bio

Matteo Collina

Matteo is the Co-Founder and CTO of Platformatic.dev with the goal to remove all friction from backend development. He is also a prolific Open Source author in the JavaScript ecosystem and modules he maintain are downloaded more than 17 billion times a year. Previously he was Chief Software Architect at NearForm, the best professional services company in the JavaScript ecosystem. In 2014, he defended his Ph.D. thesis titled "Application Platforms for the Internet of Things". Matteo is a member of the Node.js Technical Steering Committee focusing on streams, diagnostics and http. He is also the author of the fast logger Pino and of the Fastify web framework. Matteo is an renowed international speaker after more than 60 conferences, including OpenJS World, Node.js Interactive, NodeConf.eu, NodeSummit, JSConf.Asia, WebRebels, and JsDay j

@mcollina
mcollina / principles.md
Last active May 18, 2023 18:27
Matteo's Technical principles

Matteo Technical Principles

1. Conway’s Law is paramount.

Any organization that designs a system (defined broadly) will produce a design whose structure is a copy of the organization's communication structure.

In order to design a piece of software we need to “design” the team that is going to produce it.

2. Developer Experience is key to productivity

const pinoStdSerializers = require('pino-std-serializers')
const logger = require('pino')({
serializers: {
error: pinoStdSerializers.err
}
})
try {
throw new Error('kaboom')
} catch (error) {
import { createServer } from 'http'
import { connect } from 'net'
const server = createServer(function (req, res) {
console.log('request!')
server.close()
res.setHeader('Connection', 'close')
res.end('hello world')
})
// Run this with npx jest globals-jest-problem.test.js
// This is because of https://github.com/facebook/jest/issues/2549
const assert = require('assert')
test('assert', () => {
try {
assert.strictEqual(2, 3)
} catch (err) {
// This will fail
@mcollina
mcollina / sponsor-nodeland.md
Last active May 23, 2022 10:13
Sponsor Adventures in Nodeland

Last updated: May 2022


TL.DR:

  • 1700+ subscribers
  • Qualified and engaged audience that like receiving my emails