Skip to content

Instantly share code, notes, and snippets.

const Builder = @import("std").build.Builder;
const bb = @import("std").build;
const std = @import("std");
pub fn build(b: *Builder) void {
// b.linkSystemLibrary("c");
const lib = b.addSharedLibrary("popen", "popen.zig", b.version(0, 0, 1));
lib.addIncludeDir(".");
lib.linkLibC();
// lib.setTarget( .os = .windows, .arch = .x86_64, .abi = .gnu } });
@akavel
akavel / cert.x509.pem
Last active May 13, 2019 23:15
Tentative apksigner crypto
-----BEGIN CERTIFICATE-----
MIGgMIGVAgEBMAMGAQEwCTEHMAUGAQETADAaFwsxNzEwMTAyMjUwWhcLMTcxMDEw
MjI1MFowCTEHMAUGAQETADBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABLAoWrpy
dzdU6PN096BcSaDRFuC+/8MjLhgeFUiogqlrZFocHudWRHJALK08ge+x0n3nwCVB
wJ4Ybfhm0sf9nowwAwYBAQMBAA==
-----END CERTIFICATE-----
000: 6465 780a 3033 3800 7a44 cbbb fb4a e841 dex.038. zD...J.A
010: 0286 c06a 8df1 9000 3c5d e024 d073 26a2 ...j.... <].$.s&.
020: e001 0000 7000 0000 7856 3412 0000 0000 ....p... xV4.....
030: 0000 0000 6401 0000 0500 0000 7000 0000 ....d... ....p...
040: 0300 0000 8400 0000 0100 0000 9000 0000 ........ ........
050: 0000 0000 0000 0000 0200 0000 9c00 0000 ........ ........
060: 0100 0000 ac00 0000 1401 0000 cc00 0000 ........ ........
070: e400 0000 ec00 0000 0701 0000 2c01 0000 ........ ....,...
080: 2f01 0000 0100 0000 0200 0000 0300 0000 /....... ........
090: 0300 0000 0200 0000 0000 0000 0000 0000 ........ ........
@akavel
akavel / prog-philo.md
Last active February 12, 2019 21:18
Theory of programming & type systems philosophy

I've just came to a twofold realization, which in theory seems to support my longing for a "gradually provable" programming system. Specifically, I realized for some parts/modules of my code, I'd like to be able to slap a proof of a set of known properties on them, and by this, "seal them as done", and by this, just get them off my head, "forever". And in this act, elevate them to a special shelf/closet of "safe tools", stamped as reliable, safe, well understood, shrink-wrapped solutions for particular need.

And notably, I also realized, that it also surprisingly fits into a programming philosophy I've come to see as useful recently. Namely, where programming is seen somewhat similar to a scientific experiment. In that the "sofware design assumptions" form a "hypothesis", and the act of implementation is akin to an "experiment" (~ as understood by the scientific method) -- in that it (the implementation/experiment) attempts to validate or invalidate the hypothesis. Here, I'd see the formal proof as the ulti

@akavel
akavel / lgo.nix
Created October 10, 2018 07:11
WIP Nix expression for Go REPL
self: super:
let
lgo_ = { stdenv, fetchgit, myGoPackage, makeWrapper,
golang-runewidth, golang-zmq4, golang-liner, golang-sys, golang-glog }:
myGoPackage rec {
name = "github.com-yunabe-lgo";
goPackagePath = "github.com/yunabe/lgo";
src = fetchgit {
url = "https://github.com/yunabe/lgo";
@akavel
akavel / 01.md
Last active November 1, 2023 12:36

Converting fragments of real code (with error handling) to Go 2 "design draft" syntax

Part 1: A successful fragment

Following the announcement of Go 2 design drafts related to error handling (a.k.a. "if err != nil { return err }" pattern), I tried to convert a fragment of real nontrivial code (with some censoring) to the new tentative syntax. (Originally I remembered this code as particularly tricky, but I think it was rewritten in the meantime to more straightforward, so it has less impact for me than I thought it would.

@akavel
akavel / docker-compose.yml
Created May 10, 2018 15:55
scripts for upgrading gerrit with docker
version: '2'
services:
gerrit_postgres:
image: postgres:9.4
volumes:
- gerrit_postgres_data:/var/lib/postgresql/data
environment:
- POSTGRES_USER=gerrit
- POSTGRES_PASSWORD=somepassword
- POSTGRES_DB=reviewdb
@akavel
akavel / dump.lua
Created February 19, 2018 20:57 — forked from leegao/dump.lua
local function dump(list)
local str = "{"
local seen = {}
for _,v in ipairs(list) do
if type(v) ~= "table" then
str = str .. tostring(v) .. ", "
else
str = str .. dump(v) .. ", "
end
seen[_] = true
@akavel
akavel / keybase.md
Created September 27, 2017 21:26
keybase.md

Keybase proof

I hereby claim:

  • I am akavel on github.
  • I am akavel (https://keybase.io/akavel) on keybase.
  • I have a public key ASCLo2zmWoWzBw53_7qKB1FJx4HQIXd9cOi-vzmLu0TNTQo

To claim this, I am signing this object:

@akavel
akavel / dualboot.md
Created March 21, 2017 16:47
Instructions for Genode / NixOS dual-and-a-half-boot

Genode/NixOS dual-and-a-half-boot

If you've never used Genode or NixOS, or installed Gentoo, stop and consider what you are about to do.

The goal is too create a NixOS installation and a Genode installation, with the option of booting into NixOS, booting into Genode, and booting into Genode then booting the same NixOS install again in a virtual machine.