Skip to content

Instantly share code, notes, and snippets.

View vyamkovyi's full-sized avatar
🇺🇦

Vlad Yamkovyi vyamkovyi

🇺🇦
View GitHub Profile
@foxcpp
foxcpp / webfs.go
Last active September 29, 2019 17:04
Absolutely minimalistic webfs in Go
package main
import (
"errors"
"flag"
"log"
"net/http"
"os"
"path/filepath"
"strings"
@foxcpp
foxcpp / mmap_lll.c
Created August 19, 2019 15:48
The fastest Longest Line Length finding code in the West.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/mman.h>
void find_longest(const char *file, unsigned file_length,
const char **longest_start, unsigned *longest_len) {
@foxcpp
foxcpp / gobuilder.go
Last active September 29, 2019 17:18
Shameless HTTP wrapper for go get command
// Command gobuilder starts a HTTP-server that will build Go binaries based on the path given.
// Works only for Go 1.11+ (requires modules support).
//
// Usage:
// GET /importpath/revision
//
// Binaries are built for server OS and architecture by default, this can be changed
// using GOOS and GOARCH env. variables.
// gobuilder overrides following env. variables:
// GO111MODULE, GOPATH, GOBIN, GOCACHE, CGO_ENABLED.