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 / Bash snippet
Last active August 17, 2020 15:21
Bash snippet
# Bash snippet
## List service
service --status-all
ls -F /etc/init.d/ | grep '*$'
## File Descriptors
### Open socket by node.js
lsof -n -i -P | grep node | wc -l
@Eomm
Eomm / SMPP Protocol details.md
Last active March 26, 2019 16:19
Sparse information for all communication channels
@Eomm
Eomm / test-validator-ref-id
Created February 6, 2019 21:58
Fastify Snippet
const fastify = require('./fastify')({ logger: { level: 'debug' } })
fastify.addSchema({
$id: 'http://example.com/ref-to-external-validator.json',
type: 'object',
properties: {
hello: { type: 'string' }
}
})
const body = {
// Review a GitHub Pull Request ID
git fetch origin pull/ID/head:foo
git checkout foo
// View all your stashes, also which you have deleted!
git fsck --unreachable | grep commit | cut -d ' ' -f3 | xargs git log --merges --no-walk
// Restore a deleted stash
git update-ref refs/stash da02442ffa1584b489dc37a0fcf70fb1b60d9d2c -m "Piuf no one is lost"
'use strict'
const fastify = require('./fastify')({ logger: true })
// Requests
fastify.addSchema({
$id: 'Request/Auth/Login',
type: 'object',
required: ['email', 'password'],
properties: {
@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);
});
@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 / 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 / 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 / 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: