Skip to content

Instantly share code, notes, and snippets.

View alberts's full-sized avatar
🚀
Rippling is happening!

Albert Strasheim alberts

🚀
Rippling is happening!
View GitHub Profile
package main
import (
"fmt"
"io"
"net"
"net/http"
"sync"
"time"
)
package systemd
import (
"os"
"strconv"
"syscall"
)
const (
listenFdsStart = 3
package sse42
//#include <string.h>
//#cgo linux CFLAGS: -O3 -msse4.2
import "C"
import "unsafe"
func Equal(b1, b2 []byte) bool {
if len(b1) != len(b2) {
return false
package sse42
//#include <string.h>
//#cgo linux CFLAGS: -O3 -msse4.2
import "C"
import "unsafe"
func Equal(b1, b2 []byte) bool {
if len(b1) != len(b2) {
return false
@alberts
alberts / dup.go
Last active December 15, 2015 20:09
package io
import (
"os"
"syscall"
)
func dup(oldFile *os.File, flag int) (int, error) {
// Temporary file descriptor for /dev/null.
devNull, err := os.OpenFile(os.DevNull, flag, 0)
@alberts
alberts / valgrind.sql
Created December 13, 2013 19:45
postgresql-hll test script
SET client_min_messages TO NOTICE;
SELECT hll_set_output_version(1);
DROP TABLE IF EXISTS test_valgrind;
CREATE TABLE test_valgrind (id integer, set hll(11, 5, -1, 1));
INSERT INTO test_valgrind(id, set) VALUES (1, hll_empty());

CODING OPPORTUNITY: Mesosphere Storage server

Your challenge, should you choose to accept it, involves building a storage service. The storage server is meant to store arbitrary data. You are to build a REST API (HTTP/1.1, or 2.0, your choice) that presents a data storage, and retrieval API.

Environment

Your environment runs on Ubuntu 16.04 in a Docker container as a non-root user. You are allowed to write to the current working directory.

You are to build your deliverable so that it extracts into the following layout: