Skip to content

Instantly share code, notes, and snippets.

View mgdelacroix's full-sized avatar
🎧
Working from home

Miguel de la Cruz mgdelacroix

🎧
Working from home
View GitHub Profile
@mgdelacroix
mgdelacroix / penpot-with-traefik-docker-compose.yml
Created December 16, 2022 18:47
Penpot with traefik for SSL certs
---
version: "3.5"
networks:
penpot:
volumes:
penpot_postgres_data:
penpot_assets_data:
penpot_traefik_letsencrypt:
@mgdelacroix
mgdelacroix / main.go
Created October 8, 2020 12:01
Mock user directory in Go
package main
import (
"fmt"
"io/ioutil"
"os"
"os/user"
)
func main() {
@mgdelacroix
mgdelacroix / mmctl_improvements.md
Last active July 16, 2020 06:49
mmctl improvements proposal

MMCTL improvements proposal

Goals

The goal of this proposal is to outline and describe a set of changes to apply on the next iteration of mmctl, and the principles that motivate and guide those changes.

What started as specific changes closely related to the mmctl's implementation has grown to contain suggestions and good practises

@mgdelacroix
mgdelacroix / index.js
Created August 16, 2018 10:27
Simple proof of concept for nodejs SIGINT capture
let waiting = false
process.on('SIGINT', () => {
console.log('CTRL+C detected!')
if (!waiting) {
waiting = true
} else {
console.log('Was waiting, so exiting now')
process.exit(0)
}
setTimeout(() => process.exit(0), 2000)
@mgdelacroix
mgdelacroix / gogs-vbox.nix
Created November 6, 2017 12:27
Example VirtualBox VM with nginx and gogs
{
gogs =
{ config, pkgs, ... }:
{
deployment.targetEnv = "virtualbox";
deployment.virtualbox.memorySize = 512;
deployment.virtualbox.vcpu = 2;
deployment.virtualbox.headless = true;
};
}
@mgdelacroix
mgdelacroix / ytdw.go
Last active January 31, 2017 11:24
Small program to read a file and use youtube-dl to download the urls contained in it
package main
import (
"fmt"
"io/ioutil"
"os/exec"
"strings"
)
func check(e error) {
@mgdelacroix
mgdelacroix / noip.service
Last active February 2, 2018 04:55
noip2 systemd service file
[Unit]
Description=No-IP Dynamic DNS Update Client
After=network.target
[Service]
Type=forking
Restart=always
ExecStart=/usr/local/bin/noip2
[Install]
const NoSuchElementException = new Error("No such element exception");
class Optional<T> {
value: T;
constructor(value: T) {
this.value = value;
}
@mgdelacroix
mgdelacroix / jwt-test.groovy
Last active June 6, 2019 13:19
Simple script testing JWT with groovy
@Grab("io.jsonwebtoken:jjwt:0.4")
import io.jsonwebtoken.Jwts
import static io.jsonwebtoken.SignatureAlgorithm.HS256
def key = "2193872103019283092174917"
def token = Jwts.builder()
.setSubject("Hello World")
.signWith(HS256, key)
### Keybase proof
I hereby claim:
* I am mgdelacroix on github.
* I am mcrx (https://keybase.io/mcrx) on keybase.
* I have a public key whose fingerprint is 02C3 D31C DAEB 9EAE ED10 EC99 FF33 E166 37E2 E649
To claim this, I am signing this object: