Skip to content

Instantly share code, notes, and snippets.

View Eomm's full-sized avatar
🧠
Improving

Manuel Spigolon Eomm

🧠
Improving
View GitHub Profile
@Eomm
Eomm / 0_index.js
Last active October 26, 2023 16:27
Stream like a pro
'use strict'
const fs = require('node:fs/promises')
const path = require('node:path')
const { Transform, Readable } = require('node:stream')
const Fastify = require('fastify')
//
//
//
@Eomm
Eomm / draft.md
Created September 15, 2023 17:13
Schrödinger Session - Events

Organizzare un evento tech non è semplice, ma avere una community a cui chiedere consigli ed aiuto rende tutto possibile. Schrödinger Hat ti permette di fondare una CELLULA nella tua città organizzando una Schrödinger Session.

Per iniziare questa avventura è necessario creare una PULL REQUEST in questo repository https://github.com/Schrodinger-Hat/sh-sessions Rispettando il template proposto su GitHub.

I requisiti minimi per iniziare questo processo sono:

  • L'evento deve poter accogliere almeno 30 persone
@Eomm
Eomm / questionnaire.md
Created August 20, 2023 07:50
Fastify Interview

Today, we have the privilege of speaking with {NAME} a remarkable individual who runs Fastify in their production environment! With Fastify's emphasis on performance and efficiency, this user's insights are invaluable. Join us as we delve into their experiences, from selecting Fastify over other options, to overcoming challenges, and even addressing the scarcity of external resources.

Questions:

  1. Why did you choose Fastify over other Node.js frameworks for your production applications? What specific features or advantages of Fastify influenced your decision?

  2. Can you share your experience on how you convinced your company to adopt Fastify for your projects? Were there any challenges in making this case, and how did you address them?

@Eomm
Eomm / dynamic-route.js
Created November 13, 2022 09:49
Add dynamic routes to Fastify
// a quick check to implement a dynamic route plugin for fastify
const { fastify } = require('fastify')
const fp = require('fastify-plugin')
const http = require('http')
const EventEmitter = require('events')
main()
async function main () {
@Eomm
Eomm / be-constructive.md
Created September 29, 2022 12:01
I will use XYZ instead of Fastify

Why you should not say I will have to go to express to a Fastify maintainer

The number of people who come to Fastify's repositories to say they are forced to use Expressjs, or whatever, is uncountable.

So, I'm writing these lines because every time I read these words, I get upset for many reasons that I will list here.

Note I'm a Fastify contributor and the opinions expressed are solely my own and do not express the views or opinions of the Fastify community or other contributors.

So, let me share this catchy title:

@Eomm
Eomm / fastify-oss.md
Last active January 6, 2024 14:18
Start contributing to OSS

Start contributing to OSS

Do you want to start contributing to Open Souce Software and the Fastify project?

It would be best if you started asking yourself where to start:

  • Do you want to write code?
  • Do you want to understand how things work?
  • Do you like DevOps stuff?
  • Do you want to work on Github action automation?
  • Do you want to make an impact on the community?
@Eomm
Eomm / tap15-upgrade.js
Last active April 19, 2021 22:10
massive was snippet
const fs = require('fs')
const path = require('path')
// massive-wax upgrade -L -R -m 'test(/|\\)?.*\.js$' -t 'chore tap 15' -r repo-list -p ./tap-15.js -K <GITHUB_TOKEN>
module.exports = function factory (args, logger) {
return {
onRepo (repo) {
const repoPath = path.join(repo.owner, repo.repo)
const pkjPath = path.join(repoPath, './package.json')
@Eomm
Eomm / stress-memory.js
Created August 19, 2020 12:03
Check when your server goes out of memory
/**
* node --max-old-space-size=4048 --initial-old-space-size=4048 --max-heap-size=4048 stress-memory
* x64
* rss 3.39 GB
* heapTotal 3.74 GB
* heapUsed 3.73 GB
*/
const os = require('os')
console.log(os.arch())
@Eomm
Eomm / mongo query
Created February 4, 2020 15:56
Mongo copy-paste
db.getCollection("aaaaaaa").find({}).limit(10)
.forEach(function(i) {
delete i._id;
i._id = UUID().toString().split('"')[1]
i.when = new Date();
i.userId = "from_ONE_2_TWO";
db.getCollection("aaaaaaaa").insert(i);
});
'use strict'
const fastify = require('./fastify')({ logger: true })
// Requests
fastify.addSchema({
$id: 'Request/Auth/Login',
type: 'object',
required: ['email', 'password'],
properties: {