Skip to content

Instantly share code, notes, and snippets.

View nmoutschen's full-sized avatar
🦀

Nicolas Moutschen nmoutschen

🦀
View GitHub Profile
@nmoutschen
nmoutschen / diff.py
Created February 5, 2021 16:19
Service availability per region
#!/usr/bin/env python3
import json
import sys
filename = sys.argv[1]
region1 = sys.argv[2]
region2 = sys.argv[3]
@nmoutschen
nmoutschen / gen-social-image.ts
Last active August 16, 2020 17:59
Generate social media images based on a series of Markdown documents with front matter.
// Some imports
const fs = require('fs');
const matter = require('gray-matter');
const nodeHtmlToImage = require('node-html-to-image');
const path = require('path');
// Defining some constants, such as the content folder, image folder, etc.
const articlesDir = path.join(process.cwd(), 'content/articles');
const imagesDir = path.join(process.cwd(), 'assets/imgs/social');
const articleExt = '.md';
@nmoutschen
nmoutschen / master-branches.py
Created July 23, 2020 09:37
Scan all repositories that use "master" as a default branch
#!/usr/bin/env python3
import sys
from github import Github
if len(sys.argv) < 2:
print(f"USAGE: {sys.argv[0]} USERNAME")
sys.exit(1)
username = sys.argv[1]