Skip to content

Instantly share code, notes, and snippets.

View mrmelon54's full-sized avatar
🍉
Melons

Melon mrmelon54

🍉
Melons
View GitHub Profile
@aras-p
aras-p / preprocessor_fun.h
Last active July 16, 2024 02:50
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@fntlnz
fntlnz / self-signed-certificate-with-custom-ca.md
Last active July 25, 2024 12:02
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@walm
walm / main.go
Last active May 15, 2024 06:01
Simple Golang DNS Server
package main
import (
"fmt"
"log"
"strconv"
"github.com/miekg/dns"
)
@Jengas
Jengas / index.php
Last active March 26, 2024 21:40
Discord oauth2 example PHP
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
ini_set('max_execution_time', 300); //300 seconds = 5 minutes. In case if your CURL is slow and is loading too much (Can be IPv6 problem)
error_reporting(E_ALL);
define('OAUTH2_CLIENT_ID', '1234567890');
define('OAUTH2_CLIENT_SECRET', 'verysecretclientcode');
@zikani03
zikani03 / MultiplexOutputStream.java
Last active July 17, 2022 15:31
Writing to multiple output streams in Java
import java.io.IOException;
import java.io.OutputStream;
/**
* <p>
* MultiplexOutputStream allows you to write to multiple output streams "at once".
* It allows you to use one outputstream writer to write to multiple outputstreams
* without repeating yourself.
* Based off <a href="https://github.com/creditdatamw/kapenta/blob/master/src/main/java/com/creditdatamw/labs/kapenta/io/MultiplexOutputStream.java">MultiplexOutputStream.java</a>
*/