Skip to content

Instantly share code, notes, and snippets.

View ndom91's full-sized avatar

Nico Domino ndom91

View GitHub Profile
@ndom91
ndom91 / silicon.vim
Last active February 9, 2024 18:51
silicon-vim always copy to clipboard
" vim: et sw=2 sts=2
" Plugin: https://github.com/segeljakt/vim-silicon
" Description: Create beautiful images of source code.
" Maintainer: Klas Segeljakt <http://github.com/segeljakt>
"
" Update: Slightly modified to always copy to clipboard and never write image to disk - ndom91
if exists('s:autoloaded') | finish | el | let s:autoloaded = v:true | en
@ndom91
ndom91 / index.js
Last active November 29, 2023 23:07
Parallel Scheduling Test Worker
export default {
mapMap: {
'CA': '🇨🇦',
'BR': '🇧🇷',
'US': '🇺🇸',
'JP': '🇯🇵',
'UK': '🇬🇧',
'FR': '🇫🇷',
},
async fetch(request, env, ctx) {
@ndom91
ndom91 / example-eslint-ts-package.json
Last active June 21, 2023 11:06
Example `package.json` with ESLint+Prettier+Typescript
{
"name": "app",
"version": "0.0.1",
"description": "",
"main": "index.js",
"author": "",
"scripts": {
"prepare": "npx simple-git-hooks"
},
"type": "module",
@ndom91
ndom91 / auth0_user_export.sh
Created February 23, 2023 15:27
Auth0 Bulk User Export
#!/usr/bin/env bash
#
# ndom91 - 23.02.2023
# Based off of: https://github.com/ory/docs/blob/cef92348c250b06efdf65de0ce6c3721147a718c/code-examples/migrate-to-ory/0-get-auth0-user-data.sh
# Management API Tokens: https://manage.auth0.com/dashboard/eu/checkly/apis/management/explorer
# Auth0 API /users-exports docs: https://auth0.com/docs/api/management/v2#!/Jobs/post_users_exports
GREEN='\033[0;32m'
BLUE='\033[0;34m'
BRED='\033[1;31m'
@ndom91
ndom91 / devskiller.mjs
Last active January 22, 2023 13:38
NDomino Recursion Problem
import assert from 'node:assert/strict';
import { describe, it } from 'node:test';
/**
* @param {String} expression
* @description Evaluate string mathematical expression
*/
function resolve(data) {
return new Function(`return ${data}`)();
}
#!/usr/bin/env bash
#########################################
#
# Netbox Update Script
# Author: ndomino
# Update: 28.04.2022
#
# Usage: sudo ./upgrade_netbox.sh [version_number]
# i.e.: sudo ./upgrade_netbox.sh 3.1.0
@ndom91
ndom91 / create-raspi-docker-machine.sh
Created December 29, 2022 18:59
Create `docker-machine` Raspberry Pi
docker-machine create --driver generic --generic-ip-address 10.0.0.25 --generic-ssh-key ~/.ssh/id_ndo4 --generic-ssh-user ndo --engine-storage-driver overlay2 checkly-pi
@ndom91
ndom91 / totp.js
Last active June 14, 2022 07:28
js-totp (no dependencies)
// totp.js
// Description: Will generate a TOTP from 2FA Seed. No dependencies.
// Usage:
// import { TOTP } from './snippets/totp'
// console.log(TOTP(process.env.2FA_SEED))
//
// Sources:
// - Minor modernisation by ndom91
// - Minified pieces of [jsSHA](https://github.com/Caligatio/jsSHA)
// - [js-otp](https://github.com/jiangts/JS-OTP)
@ndom91
ndom91 / haproxy.cfg
Last active June 8, 2022 15:48
HAProxy JSON Body Routing Config
global
stats socket /var/run/api.sock user haproxy group haproxy mode 660 level admin expose-fd listeners
log stdout format raw local0 info
defaults
mode http
timeout client 10s
timeout connect 5s
timeout server 10s
timeout http-request 10s
@ndom91
ndom91 / upgrade_netbox.sh
Created April 28, 2022 21:51
Automated Upgrade Netbox Bash Script
#!/usr/bin/env bash
#########################################
#
# Netbox Update Script
# Author: ndomino
# Update: 28.04.2022
#
# Usage: sudo ./upgrade_netbox.sh [version_number]
# i.e.: sudo ./upgrade_netbox.sh 3.1.0