Skip to content

Instantly share code, notes, and snippets.

@dhl
dhl / hack4dimsum.md
Created April 23, 2014 14:55
Hack for Dim Sum

= Things to do =

  • Create a CRUD system to manage member data
  • Connect the member system to grant/deny access to dootdoorlock
  • Setup CMS (Wordpress?)
  • Connect the member system to auto create/delete account on CMS
  • Connect the member system to mailing list

Keybase proof

I hereby claim:

  • I am dhl on github.
  • I am dhl (https://keybase.io/dhl) on keybase.
  • I have a public key whose fingerprint is 217E 1ECE 2349 D178 73E5 C194 1E2E C02A A74A A531

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am dhl on github.
  • I am dhl (https://keybase.io/dhl) on keybase.
  • I have a public key whose fingerprint is 217E 1ECE 2349 D178 73E5 C194 1E2E C02A A74A A531

To claim this, I am signing this object:

@dhl
dhl / eventemitter3_demo.html
Last active February 28, 2018 16:07
Example of Inter Object Communication with EventEmitter3
<!doctype>
<html>
<head>
<title>Inter Object Communication Example</title>
</head>
<body>
<h1>OrderBooks</h1>
<p id="orders"></p>
@dhl
dhl / web3js-1.0.0-beta.31_clearSubscriptions_bug_demo.html
Last active June 21, 2018 06:59
Demo of web3.shh.clearSubscriptions Bug
<!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');
@dhl
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.
/*
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 / cljs.sh
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
package main
import (
"context"
"log"
"net/http"
"os"
"os/signal"
"time"
)
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(
@dhl
dhl / nix_channel_age.sh
Created October 19, 2018 02:43
Find out how old a Nix channel is
curl -sS http://howoldis.herokuapp.com/api/channels | jq -c 'map(select(.name == "nixos-unstable") | .humantime) | .[]'