Skip to content

Instantly share code, notes, and snippets.

View hpoul's full-sized avatar
🚴

Herbert Poul hpoul

🚴
View GitHub Profile

Contributor Agreement

Individual Contributor Exclusive License Agreement

(including the Traditional Patent License OPTION)

Thank you for your interest in contributing to CodeUX.design e.U. (Herbert Poul)'s kdbx.dart ("We" or "Us").

The purpose of this contributor agreement ("Agreement") is to clarify and document the rights granted by contributors to Us. To make this document effective, please follow the instructions at https://authpass.app/kdbx-cla/.

@hpoul
hpoul / main.dart
Last active August 15, 2020 10:18
CheckboxListTile tristate
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',

Contributor Agreement

Individual Contributor Non-Exclusive License Agreement

(including the Traditional Patent License OPTION)

Thank you for your interest in contributing to CodeUX.design e.U. (Herbert Poul)'s AuthPass ("We" or "Us").

@hpoul
hpoul / upgrade-gradle-wrapper.sh
Created July 28, 2020 08:26
One liner to upgrade gradle wrapper to latest version and set sha distribution checksum.
json=$(curl -sf https://services.gradle.org/versions/current) && v=$(echo $json | jq -r '.version') && sha=$(curl -sfL $(echo $json | jq -r '.checksumUrl' | sed 's/bin/all/')) && ./gradlew wrapper --distribution-type all --gradle-distribution-sha256-sum "$sha" --gradle-version "$v"
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
import 'dart:async';
void main() async {
final a = StreamController.broadcast(onListen: () {
print('onListen.');
}, onCancel: () {
print('onCancel');
});
final aasub = a.stream.listen((data) {
print('aa: $data');
class FirstError { }
class SecondError { }
Future<void> someApi() {
return Future(() {
throw FirstError();
}).catchError((error, stackTrace) {
print("inner: $error");
// although `throw SecondError()` has the same effect.
return Future.error(SecondError());
#!/usr/bin/env bash
# Create a continous, consistent buildnumber independent of branch.
#
# when run it will:
# 1. check if the current commit has already a build number (as a note in `refs/notes/buildnumbers`)
# 2. increment build number located in an object referenced in `refs/buildnumbers/last`
# (starting at 1 if it does not exist)
# 3. store the new buildnumber for the commit (in a note in `refs/notes/buildnumbers`)
#
@hpoul
hpoul / daemon.log
Last active November 7, 2018 16:44
logs for https://github.com/moby/moby/issues/38092 //// Unresponsive container, all commands stuck (kill, logs, exec, etc.)
Oct 26 17:19:31 docker-host dockerd[473]: time="2018-10-26T17:19:31.210520830+02:00" level=warning msg="Health check for container 74b12161d2289ada6ef5795a1c4bbbd8cf12e60da5be8905e391c4d0a21d6f9a error: context deadline exceeded"
Oct 26 17:20:09 docker-host dockerd[473]: time="2018-10-26T17:20:09.690872357+02:00" level=info msg="NetworkDB stats docker-host(a5c8ecf444a9) - netID:gozqkaobyvb7baliptnbkpnbz leaving:false netPeers:1 entries:5 Queue qLen:0 netMsg/s:0"
Oct 26 17:20:09 docker-host dockerd[473]: time="2018-10-26T17:20:09.690969642+02:00" level=info msg="NetworkDB stats docker-host(a5c8ecf444a9) - netID:pm4oxyhccs2jmbtdditxab8u2 leaving:false netPeers:1 entries:12 Queue qLen:0 netMsg/s:0"
Oct 26 17:20:09 docker-host dockerd[473]: time="2018-10-26T17:20:09.690998753+02:00" level=info msg="NetworkDB stats docker-host(a5c8ecf444a9) - netID:xa0t1054tkj02uewi9h7iyyrj leaving:false netPeers:1 entries:13 Queue qLen:0 netMsg/s:0"
Oct 26 17:20:09 docker-host dockerd[473]: time="2018-10-26T17:20:09.691023898+02:
@hpoul
hpoul / .gitignore
Last active June 15, 2020 11:50
Scratchbook for my favorite .gitignore
# https://gist.github.com/hpoul/b78f7a1b3cde988f3ce4d12e954367eb
#
# IDEA: Allow some configuration, which is shared across users.
/.idea/*
!.idea/runConfigurations
!.idea/runConfigurations/*
!.idea/vcs.xml
!.idea/dictionaries
!.idea/dictionaries/*