Skip to content

Instantly share code, notes, and snippets.

Avatar

Ævar Arnfjörð Bjarmason avar

View GitHub Profile
@avar
avar / coord.c
Created Dec 6, 2018
Shows that (in practice, not standard) structs are just a fancy linear container of their types (assuming alignment works out) in memory
View coord.c
#include <stdio.h>
#include <stdlib.h>
struct coord {
int x;
int y;
int z;
};
int main(void)
@avar
avar / pipe_buf_test.pl
Last active Aug 14, 2018
PIPE_BUF test
View pipe_buf_test.pl
#!/usr/bin/env perl
use v5.10.1;
use strict;
use warnings;
use Fcntl ':DEFAULT';
# Usage:
# >/tmp/append; perl pipe_buf_test.pl /tmp/append A $((2**12)) 4
# Will write 4 lines of 4095 "A"s and \n to /tmp/append
my ($file, $byte, $length, $times) = @ARGV;
@avar
avar / 19505ad6d4750773b2765f769e2783b572683bda.txt
Created May 2, 2018
19505ad6d4750773b2765f769e2783b572683bda
View 19505ad6d4750773b2765f769e2783b572683bda.txt
19505ad6d4750773b2765f769e2783b572683bda
View 553210331714069.pl
sub meth {
return unless my $self = instance();
return unless my $can = $self->yes_I_can;
return unless my $worker = $self->get_worker($can);
return $worker->work;
}
sub meth {
my $self = instance() or return;
View dovecot-session.txt
$ nc maildirector.example.com 143
* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE STARTTLS AUTH=PLAIN AUTH=LOGIN] Dovecot ready.
0 LOGIN gitlab@example.com "PASSWORD"
0 OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS BINARY MOVE NOTIFY] Logged in
1 EXAMINE "INBOX"
* FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
* OK [PERMANENTFLAGS ()] Read-only mailbox.
* 0 EXISTS
* 0 RECENT
* OK [UIDVALIDITY 1512810065] UIDs valid
@avar
avar / .block
Created Oct 23, 2017 — forked from JohannDK/.block
Dreifing frambjóðenda á pólitíska rófinu
View .block
license: mit
height: 550
border: no
scrolling: no
@avar
avar / .block
Created Oct 23, 2017 — forked from borgar/.block
Dreifing frambjóðenda á pólitíska rófinu
View .block
license: mit
height: 550
border: no
scrolling: no
View 87bmno5ypu.fsf@gmail.com.eml
From: =?utf-8?B?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason <avarab@gmail.com>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org, Tor Arntsen <tor@spacetec.no>, Randal L. Schwartz <merlyn@stonehenge.com>, Jakub Narebski <jnareb@gmail.com>, Tom G. Christensen <tgc@statsbiblioteket.dk>
Subject: Dropping support for older perl (was: curl)
References: <20170809120024.7phdjzjv54uv5dpz@sigill.intra.peff.net>
User-agent: Debian GNU/Linux 8.9 (jessie); Emacs 25.1.1; mu4e 0.9.19
In-reply-to: <20170809120024.7phdjzjv54uv5dpz@sigill.intra.peff.net>
Date: Wed, 09 Aug 2017 21:26:53 +0200
Message-ID: <87bmno5ypu.fsf@gmail.com>
MIME-Version: 1.0
View aspell-is-ís$
abbadís
Árdís
arís
Arndís
Ásdís
bakarís
bergdís
bjarndís
borgarís
brennisteinskís
View sunos.diff
$ git diff -U15
diff --git a/git-compat-util.h b/git-compat-util.h
index bd04564a69..38c806acff 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -119,30 +119,37 @@
#define decimal_length(x) ((int)(sizeof(x) * 2.56 + 0.5) + 1)
#if defined(__sun__)
/*