Skip to content

Instantly share code, notes, and snippets.

View alloyapple's full-sized avatar
🏠
Working from home

alloy alloyapple

🏠
Working from home
View GitHub Profile
@alloyapple
alloyapple / WireGuard_Setup.txt
Created May 19, 2020 06:59 — forked from chrisswanda/WireGuard_Setup.txt
Stupid simple setting up WireGuard - Server and multiple peers
Install WireGuard via whatever package manager you use. For me, I use apt.
$ sudo add-apt-repository ppa:wireguard/wireguard
$ sudo apt-get update
$ sudo apt-get install wireguard
MacOS
$ brew install wireguard-tools
Generate key your key pairs. The key pairs are just that, key pairs. They can be
@alloyapple
alloyapple / match.c
Created August 1, 2016 03:16 — forked from ianmackinnon/match.c
C Regex multiple matches and groups example
# gcc -Wall -o match match.c && ./match
#
#include <stdio.h>
#include <string.h>
#include <regex.h>
@alloyapple
alloyapple / partial.swift
Created July 19, 2016 04:07 — forked from kristopherjohnson/partial.swift
Experiments with partial function application in Swift
func partial<A, B, T>(f: (A, B) -> T, a: A) -> (B) -> T {
return { f(a, $0) }
}
func bind2nd<A, B, T>(f: (A, B) -> T, b: B) -> (A) -> T {
return { f($0, b) }
}
func partial<A, B, C, T>(f: (A, B, C) -> T, a: A) -> (B, C) -> T {