Skip to content

Instantly share code, notes, and snippets.

@renehamburger
renehamburger / check-user-beancounters.js
Last active April 4, 2020 20:20
Send user_beancounters metrics to CloudRadar
#!/usr/bin/env node
// How to use:
// 1. Create a custom check on CloudRadar called 'beancounters', which should be updated every 5 minutes.
// 2. Insert the custom check token below.
// 3. Execute this script every 5 minutes with root privileges,
// e.g. by calling `sudo crontab -e` and adding `*/5 * * * * /usr/bin/node /<Path to script>/check-user-beancounters.js`
const axios = require('axios').default;
const { exec } = require('child_process');
@renehamburger
renehamburger / slimdown.js
Last active September 4, 2023 07:55
slimdown.js
'use strict';
/**
* Javascript version of https://gist.github.com/jbroadway/2836900
*
* Slimdown - A very basic regex-based Markdown parser. Supports the
* following elements (and can be extended via Slimdown::add_rule()):
*
* - Headers
* - Links