Skip to content

Instantly share code, notes, and snippets.

View haarts's full-sized avatar

Harm Aarts haarts

View GitHub Profile
colorscheme zenburn
add-highlighter global/ number-lines -relative
add-highlighter global/ show-matching
hook global WinSetOption filetype=python %{
hook window InsertChar \t -group python-indent %{ exec -draft h@ }
}
hook global WinSetOption filetype=git-commit %{
autowrap-enable
root = true
# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
# 2 space indentation
[*.dart]
indent_style = space
indent_size = 2
@haarts
haarts / secp256k1.dart
Last active April 20, 2022 13:59
Demo secp256k1 key pair generation with PointyCastle
import "dart:typed_data";
import "dart:math";
import "package:pointycastle/pointycastle.dart";
import "package:pointycastle/export.dart";
import "package:pointycastle/api.dart";
import "package:pointycastle/ecc/api.dart";
import "package:pointycastle/ecc/curves/secp256k1.dart";
import "package:pointycastle/key_generators/api.dart";
import "package:pointycastle/key_generators/ec_key_generator.dart";
import "package:pointycastle/random/fortuna_random.dart";
@haarts
haarts / collections.dat
Created February 3, 2017 12:07
Which Java Collection is used most often?
ArrayList 20870423
Stack 13799424
HashSet 3862284
Vector 3855212
LinkedList 2543036
TreeSet 589965
LinkedHashSet 366171
EnumSet 289934
LinkedBlockingQueue 207736
PriorityQueue 136294
function verify_container_running --argument-names container
set container_status (curl -s -k --cert ~/.config/lxc/client.crt --key ~/.config/lxc/client.key https://localhost:8443/1.0/containers/$container | jq '.metadata.status')
if [ $container_status != "\"Running\"" ]
lxc start $container
end
end
<html>
<body>
<ul id="list">
<ul/>
<script type="text/javascript">
var list = document.querySelector("#list");
function createListItem(show) {
var link = document.createElement("a");
@haarts
haarts / install_curveZMQ
Last active August 29, 2015 14:09
Setup CurveZMQ and Go
This is a brief description on getting CurveZMQ going on Ubuntu 14.04. This assumes a working Go installation.
Order is important since ZeroMQ will check during compilation if libsodium is installed.
1. $ sudo apt-get install pkg-config
1. $ curl -O https://download.libsodium.org/libsodium/releases/libsodium-1.0.0.tar.gz
1. $ tar xzf libsodium-1.0.0.tar.gz
1. $ cd libsodium-1.0.0
1. $ ./configure && make && make check && sudo make install && sudo ldconfig
1. $ cd
1. $ curl -O http://download.zeromq.org/zeromq-4.0.5.tar.gz
@haarts
haarts / gist:1452142b0d19fdf2ceaa
Created November 11, 2014 12:43
Terminal output after switch BACK to Chrome OS (from Trusty)
chronos@localhost ~/Downloads $ sudo enter-chroot -n trusty
Entering /mnt/stateful_partition/crouton/chroots/trusty...
(trusty)harm@localhost:~$ startxfce4
/usr/bin/startxfce4: Starting X server
X.Org X Server 1.15.1
Release Date: 2014-04-13
X Protocol Version 11, Revision 0
Build Operating System: Linux 3.2.0-61-generic x86_64 Ubuntu
@haarts
haarts / gist:80a5362c4895a5a3700b
Created November 11, 2014 12:29
Message on the terminal after logging out of XFCE
Running exit commands...
/usr/bin/xinit: connection to X server lost
waiting for X server to shut down xscreensaver: 13:28:19: SIGHUP received: restarting...
xscreensaver: 13:28:19: running as harm/harm (1000/1000)
xscreensaver: 13:28:19: Can't open display: :1.0
xscreensaver: 13:28:19: running as harm/harm (1000/1000)
xscreensaver: 13:28:19: Errors at startup are usually authorization problems.
@haarts
haarts / gist:6b6a5568ef4b5761392b
Created November 11, 2014 12:27
Terminal output after switch BACK to Chrome OS
chronos@localhost ~/Downloads $ sudo startxfce4
Entering /mnt/stateful_partition/crouton/chroots/precise...
/usr/bin/startxfce4: Starting X server
X.Org X Server 1.15.1
Release Date: 2014-04-13
X Protocol Version 11, Revision 0
Build Operating System: Linux 2.6.42-61-generic x86_64 Ubuntu
Current Operating System: Linux localhost 3.10.18 #1 SMP Wed Nov 5 23:26:34 PST 2014 x86_64