Skip to content

Instantly share code, notes, and snippets.

View gkweb's full-sized avatar
😎

Glade gkweb

😎
View GitHub Profile
@gkweb
gkweb / generate-medicare-card-numbers.ts
Created March 16, 2022 00:51
Medicare number generator
const fs = require('fs')
// Grabbed from here: https://gist.github.com/Ugrend/09890dbc7a049651d470d1f8b6b73e1a
function randomMedicareNumber(): string {
let sum = Math.floor(Math.random() * 5) + 2
const weights = [1, 3, 7, 9, 1, 3, 7, 9]
const num = [sum]
for (let i = 0; i < 7; i++) {
const n = Math.floor(Math.random() * 10)
sum += n * weights[i + 1]
@gkweb
gkweb / copy-and-paste-netlify-config.mjs
Created June 27, 2022 03:51
Copy and paste netlify config based on ENV var
import fs from 'fs'
import path from 'path'
// Requires folder structure
// config
// -> netlify
// Run with NETLIFY_CONFIG_FILE=netlify.develop.toml node scripts/copy-netlify-config-to-root.mjs
// ^^ You get the picture