Skip to content

Instantly share code, notes, and snippets.

View xor-gate's full-sized avatar
👽

Jerry Jacobs xor-gate

👽
View GitHub Profile
@xor-gate
xor-gate / shortener.go
Last active August 29, 2015 14:27
URL shortener
package main
import (
"fmt"
"log"
"math/rand"
"net/http"
"time"
"github.com/garyburd/redigo/redis"
@xor-gate
xor-gate / 01README.md
Last active November 23, 2015 23:12
Restic HTTP backend test server
@xor-gate
xor-gate / 01README.md
Last active November 26, 2015 19:22
http-sftp-share

HTTP-SFTP file server in golang

@xor-gate
xor-gate / 01README.md
Last active November 26, 2015 19:23
xmacro-codegen

X-Macros Code Generator in C11

Because we can and the C-preprocessor is wasting CPU cycles anyway

@xor-gate
xor-gate / 01README.md
Last active November 26, 2015 19:26
webdav golang 1.5

Golang 1.5 webdav readonly fileshare

@xor-gate
xor-gate / !README.md
Last active November 26, 2015 20:12
c-struct-serializer-msgpack

C Struct Serializer to MessagePack

@xor-gate
xor-gate / mountpoint.c
Created December 23, 2015 13:22 — forked from twslankard/mountpoint.c
Using stat to determine programmatically whether a file is a mount point.
#include <assert.h>
#include <sys/stat.h>
#include <stdint.h>
#include <libgen.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char * argv[]) {
@xor-gate
xor-gate / url-shortner.c
Created December 25, 2015 12:26 — forked from ftonello/url-shortner.c
URL shortner implementation in C. This is just an example how it could be implemented. Ideally the lookup table should be pre-generated and not hardcoded.
/**
* Author: Felipe Ferreri Tonello <eu@felipetonello.com>
*
* This url-shortner it only works with ASCII characters. It encodes and
* decodes ids.
* You can change base_x as you wish.
*
* It runs at least 20 times faster then a Python implementation.
*
* $ time python url-shortner.py -s I7
@xor-gate
xor-gate / client.go
Created January 7, 2016 12:43 — forked from spikebike/client.go
TLS server and client
package main
import (
"crypto/tls"
"crypto/x509"
"fmt"
"io"
"log"
)
@xor-gate
xor-gate / orhttp_example.go
Created January 24, 2016 13:47 — forked from Yawning/orhttp_example.go
How to dispatch HTTP requests via Tor in Go.
// To the extent possible under law, the Yawning Angel has waived all copyright
// and related or neighboring rights to orhttp_example, using the creative
// commons "cc0" public domain dedication. See LICENSE or
// <http://creativecommons.org/publicdomain/zero/1.0/> for full details.
package main
import (
// Things needed by the actual interface.
"golang.org/x/net/proxy"