This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdint.h> | |
#include <stdlib.h> | |
#include <assert.h> | |
#include <stdio.h> | |
#include <time.h> | |
typedef union rnd_state_t { | |
uint64_t s64; | |
uint32_t s32[2]; | |
uint16_t s16[4]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"database/sql" | |
"fmt" | |
"os" | |
"time" | |
_ "github.com/mattn/go-sqlite3" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include <stdexcept> | |
#include <iterator> | |
struct utf8_error : public std::runtime_error { | |
utf8_error(const char* v) : std::runtime_error(v) {} | |
}; | |
#if defined(__cpp_exceptions) && !defined(UTF8_IT_NOEXCEPT) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include <memory> | |
#include <shared_mutex> | |
/* | |
* std::shared_mutex + T value wrapper written out of boredom. | |
* Needs C++17 support to compile. | |
* | |
* It phohibits direct manipulation of T value without locking the mutex in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bytes" | |
"flag" | |
"fmt" | |
"io" | |
"io/ioutil" | |
"log" | |
"net/smtp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"errors" | |
"flag" | |
"log" | |
"net/http" | |
"os" | |
"path/filepath" | |
"strings" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
wrapped_name=scmp-confine | |
function wrapped { | |
flags=$1 | |
shift | |
exec scmp-confine $flags "$@" | |
} | |
set -euo pipefail |