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/parameterized.py", line 518, in standalone_func
return func(*(a + p.args), **p.kwargs)
File "/build/source/tests/functional/test_cli.py", 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/subprocess.py", line 394, in __init__
errread, errwrite)
View default.nix
{ pkgsPath ? <nixpkgs>, crossSystem ? null }:
let
mozOverlay = import (
builtins.fetchTarball https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz
);
pkgs = import pkgsPath {
overlays = [ mozOverlay ];
inherit crossSystem;
};
@dhl
dhl / nixos-install-encrypted-root.sh
Created Oct 31, 2018 — forked from sveitser/nixos-install-encrypted-root.sh
Installs nixos on encrypted root from live CD.
View nixos-install-encrypted-root.sh
#!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.
View programming_naming_conventions.md

Naming Conventions in Code

Verify

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

Validate

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
dhl / nix_channel_age.sh
Created Oct 19, 2018
Find out how old a Nix channel is
View nix_channel_age.sh
curl -sS http://howoldis.herokuapp.com/api/channels | 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> =
Reflect.getOwnMetadata(
View drain.go
package main
import (
"context"
"log"
"net/http"
"os"
"os/signal"
"time"
)
@dhl
dhl / cljs.sh
Last active Jul 5, 2018
Minimal example ot run ClojureScript reopl on Nix with nix-shell
View cljs.sh
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
dhl / riot_key_verification.js
Last active Jul 3, 2018
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
dhl / web3js-1.0.0-beta.31_clearSubscriptions_bug_demo.html
Last active Jun 21, 2018
Demo of web3.shh.clearSubscriptions Bug
View web3js-1.0.0-beta.31_clearSubscriptions_bug_demo.html
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>web3.shh.clearSubscriptions bug demo</title>
</head>
<body>
<script src="https://rawgit.com/ethereum/web3.js/1.0/dist/web3.min.js"></script>
<script>
const web3 = new Web3('ws://localhost:8546');