Skip to content

Instantly share code, notes, and snippets.

View leifbladt's full-sized avatar

Leif Bladt leifbladt

  • Freiburg, Germany
View GitHub Profile

Keybase proof

I hereby claim:

  • I am leifbladt on github.
  • I am lbladt (https://keybase.io/lbladt) on keybase.
  • I have a public key ASCIze_J0bcCv1qCINDRy21_wxmiqB95iUFAerK6J3TCgQo

To claim this, I am signing this object:

#!/bin/sh
BOOT2DOCKER_CERTS_DIR=/var/lib/boot2docker/certs
CERTS_DIR=/etc/ssl/certs
CAFILE=${CERTS_DIR}/ca-certificates.crt
for cert in $(/bin/ls -1 ${BOOT2DOCKER_CERTS_DIR}); do
SRC_CERT_FILE=${BOOT2DOCKER_CERTS_DIR}/${cert}
CERT_FILE=${CERTS_DIR}/${cert}
HASH_FILE=${CERTS_DIR}/$(/usr/local/bin/openssl x509 -noout -hash -in ${SRC_CERT_FILE} 2>/dev/null)
class Broker {
public:
void subscribe(void (*f)()) {
_f = f;
}
void notify() {
(_f)();
}
@leifbladt
leifbladt / test.cpp
Created November 27, 2012 12:20
Publish subscribe
#include <iostream>
using namespace std;
class Broker {
public:
Broker() : pos(0) {}
void subscribe(void (*f)()) {
_f[pos] = f;
@leifbladt
leifbladt / gist:1312840
Created October 25, 2011 14:06 — forked from richardlawrence/gist:1299371
Convert a Capybara table to something you can diff with a Cucumber table
# change 'table' to a more specific selector when the page will have more than one table
find('table').all('tr').map { |row| row.all('th, td').map { |cell| cell.text.strip } }