Skip to content

Instantly share code, notes, and snippets.

View aws-lambda-builders_build_error
ERROR: test_run_hello_workflow_incompatible_0_request_through_stdin (tests.functional.test_cli.TestCliWithHelloWorkflow)
Traceback (most recent call last):
File "/nix/store/8h7vxyym56zxf03bb3w8dwifr9pv2pan-python2.7-parameterized-0.7.0/lib/python2.7/site-packages/parameterized/", line 518, in standalone_func
return func(*(a + p.args), **p.kwargs)
File "/build/source/tests/functional/", line 149, in test_run_hello_workflow_incompatible
p = subprocess.Popen([self.command_name], env=env, stdin=subprocess.PIPE, stdout=subprocess.PIPE)
File "/nix/store/gy3r9y4rvs7rlxm88az4lxqsrr2020f2-python-2.7.15/lib/python2.7/", line 394, in __init__
errread, errwrite)
dhl / default.nix
Last active April 3, 2019 02:19
Compiling rust against musl target with Nix. Adapted from
View default.nix
{ pkgsPath ? <nixpkgs>, crossSystem ? null }:
mozOverlay = import (
pkgs = import pkgsPath {
overlays = [ mozOverlay ];
inherit crossSystem;
dhl /
Created October 31, 2018 02:41 — forked from sveitser/
Installs nixos on encrypted root from live CD.
#!usr/bin/env bash
# Installs nixos with full disk encrypted root partition.
# - Prompts for password initially, after that no interaction should
# be required.
# - At the end it will prompt for a root password, could not make
# echo-ing it into nixos-install work.
# - Reserves 550MB for boot partition, rest for the root volume.
# - After booting, log in as root user and set password for normal user.

Naming Conventions in Code


Tests if some subject (object or data) passes the correctness definition for some type. Returns true if the test passes, and false otherwise.


Tests if some subject (object or data) passes the correctness definition for some type. Throws an exception if the subject did not pass the test. The test is not required to return any meainingful value if the test pases.

dhl /
Created October 19, 2018 02:43
Find out how old a Nix channel is
curl -sS | jq -c 'map(select(.name == "nixos-unstable") | .humantime) | .[]'
View typescript_decorator_based_validation.ts
const validationFunctionMetadataKey = Symbol.for('validate::func')
function makeParamValidator(validator: Function) {
return (
target: Object,
propertyKey: string | symbol,
parameterIndex: number
) => {
let existingValidationParameters: Map<any, Function> =
View drain.go
package main
import (
dhl /
Last active July 5, 2018 06:41
Minimal example ot run ClojureScript reopl on Nix with nix-shell
echo '{:deps {org.clojure/clojurescript {:mvn/version "1.10.339"}}}' > deps.edn && nix-shell -p clojure rlwrap nodejs-8_x
# once nix-shell loads up
# $ clj -m cljs.main --repl-env node
dhl / riot_key_verification.js
Last active July 3, 2018 06:07
Quick and dirty hack to verify a long list of devices in Riot's "Unknown Device" dialog.
View riot_key_verification.js
Quick and dirty hack. USE AT YOUR OWN RISK.
function clickVerifyInDialog() { $('.mx_Dialog_primary').click() }
function verifyFirstKey() { $('.mx_UnknownDeviceDialog .mx_MemberDeviceInfo_verify').click() }
function hasKeyToVerify() { return $('.mx_UnknownDeviceDialog .mx_MemberDeviceInfo_verify') }
function verificationIsDisplayed() {
return $('#mx_BaseDialog_title').innerHTML == 'Verify device'
dhl / web3js-1.0.0-beta.31_clearSubscriptions_bug_demo.html
Last active June 21, 2018 06:59
Demo of web3.shh.clearSubscriptions Bug
View web3js-1.0.0-beta.31_clearSubscriptions_bug_demo.html
<!doctype html>
<meta charset="utf-8">
<title>web3.shh.clearSubscriptions bug demo</title>
<script src=""></script>
const web3 = new Web3('ws://localhost:8546');