Skip to content

Instantly share code, notes, and snippets.

View gombosg's full-sized avatar

Gergely Gombos gombosg

View GitHub Profile
@yekver
yekver / prom-client_pm2_cluster.js
Last active August 11, 2023 18:47
Instead of `cluster` module there is no direct access to the master process in `pm2`. To return metrics for the whole cluster you can do IPC calls from the active instance to the rest of them and wait while all their locally collected metrics will be sent. Finally you have to aggregate all received metrics.
const prom = require('prom-client');
const pm2 = require('pm2');
let pm2Bus;
const REQ_TOPIC = 'get_prom_register';
function pm2exec(cmd, ...args) {
return new Promise((resolve, reject) => {
pm2[cmd](...args, (err, resp) => (err ? reject(err) : resolve(resp)));
@johnleider
johnleider / bash
Last active November 19, 2018 18:52
Docs next
# Fork vuetify https://github.com/vuetifyjs/vuetify
git clone your-fork
cd vuetify
git checkout feat/docs-next
yarn
yarn build
lerna run dev --scope vuetifyjs.com --stream
@alexeds
alexeds / move-stashes.md
Created September 5, 2012 18:00
Move your stashes from one repo to another

Move your stashes from one repo to another


This was useful for me when we created a new branch for a new major release, but were still working on our current version as well. I cloned our repo again and kept the new project on our new branch, but also wanted to get my stashes there.

Download your stashes

git stash show -p > patch

You'll have to specify your stash and name your file whatevery you want. Do this for as all your stashes, and you'll have patch files in your pwd.