I hereby claim:
- I am dwburke on github.
- I am dwburke (https://keybase.io/dwburke) on keybase.
- I have a public key whose fingerprint is 0106 655F A8B4 CAC0 41F8 F116 C79E A36B 43A4 49E0
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
# from http://mah.everybody.org/docs/ssh | |
SSH_ENV="$HOME/.ssh/environment" | |
function start_agent { | |
echo "Initialising new SSH agent..." | |
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}" | |
echo succeeded | |
chmod 600 "${SSH_ENV}" | |
. "${SSH_ENV}" > /dev/null |
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use JSON; | |
STDOUT->autoflush; | |
use Net::AMQP::RabbitMQ; |
#!/bin/bash | |
# todo - modify swap | |
sudo apt-get install g++ protobuf-compiler libprotobuf-dev \ | |
libboost-dev curl m4 wget libssl-dev | |
wget https://download.rethinkdb.com/dist/rethinkdb-2.3.5.tgz | |
tar xf rethinkdb-2.3.5.tgz |
#!/usr/bin/env perl | |
use strict; | |
use AnyEvent; | |
use AnyEvent::Util; | |
my $cv = AnyEvent->condvar; | |
$AnyEvent::Util::MAX_FORKS = 5; |
// from http://stackoverflow.com/questions/2896600/how-to-replace-all-occurrences-of-a-character-in-string | |
// std::string tmp = ReplaceAll(description, std::string("%"), name); | |
std::string ReplaceAll(std::string str, const std::string& from, const std::string& to) { | |
size_t start_pos = 0; | |
while((start_pos = str.find(from, start_pos)) != std::string::npos) { | |
str.replace(start_pos, from.length(), to); | |
start_pos += to.length(); // Handles case where 'to' is a substring of 'from' | |
} |
for (auto i = list.begin(); i != list.end();) { | |
if (condition) | |
i = list.erase(i); | |
else | |
++i; | |
} | |
or |
#!/bin/bash | |
set -eu | |
die () { | |
echo >&2 "$@" | |
exit 1 | |
} | |
[ "$#" -eq 1 ] || die "Usage: $0 <username>" |
#pragma once | |
template <typename T, typename KEYT, typename... Args> | |
class Factory | |
{ | |
public: | |
template <typename TDerived> | |
void registerType(KEYT key) | |
{ | |
static_assert(std::is_base_of<T, TDerived>::value, "Factory::registerType doesn't accept this type because doesn't derive from base class"); |
class Pipe { | |
public: | |
Pipe() {}; | |
Pipe(char *command, char *mode) { | |
open(command, mode); | |
}; | |
~Pipe() { | |
if (pfp) | |
pclose(pfp); |