Instantly share code, notes, and snippets.

View collinear.cpp
#define BOOST_TEST_MODULE collinear
#include <boost/test/unit_test.hpp>
#include <boost/range/algorithm/generate.hpp>
#include <set>
#include <cmath>
struct Point {
int x;
int y;
};
View xmlgen.sh
#!/bin/bash
# Creates an XML element from the first parameter. Remaining parameters and all stdin are copied to stdout.
function elem() {
local name=$1
echo -n "<$name>"
shift
echo -n $*
[[ ! -t 0 ]] && cat
echo "</$name>"
View gist:489dc5e6deb2e4839671

Keybase proof

I hereby claim:

  • I am randomphrase on github.
  • I am randomphrase (https://keybase.io/randomphrase) on keybase.
  • I have a public key whose fingerprint is 64E4 B67C D2B7 EEC4 63C9 AA74 F63A 9AD9 E44B 21C7

To claim this, I am signing this object:

View array_copy.cpp
// -*- mode: c++; c-basic-offset: 4 -*-
#include <boost/timer.hpp>
#include <algorithm>
#include <random>
#include <cstring>
#include <iostream>
#include <iomanip>
#include <stdexcept>
const unsigned WARMUP = 5;
View cmdoptions.cpp
#define BOOST_TEST_MODULE subcommand options
#include <boost/test/unit_test.hpp>
#include <boost/program_options.hpp>
#include <boost/variant/variant.hpp>
#include <boost/variant/get.hpp>
struct GenericOptions {
bool debug_;
};
View semantic-browse-c++-doc.el
(defun c++-type-at (point)
"Use semantic to determine the fully namespace-qualified type of the symbol at POINT."
(interactive "d")
(let* ((ctxt (semantic-analyze-current-context point))
(pf (reverse (oref ctxt prefix)))
(lastname (pop pf))
(tag (if (semantic-tag-p lastname) lastname (car pf)))
(names (append
(when (semantic-tag-p tag)
(save-excursion
View gist:7744453
alastair@lulu ~/.emacs.d ±master⚡ » cask
Contacting host: orgmode.org:80
Saving file /Users/alastair/.emacs.d/.cask/24.3.1/elpa/archives/org/archive-contents...
Wrote /Users/alastair/.emacs.d/.cask/24.3.1/elpa/archives/org/archive-contents
Contacting host: marmalade-repo.org:80
Saving file /Users/alastair/.emacs.d/.cask/24.3.1/elpa/archives/marmalade/archive-contents...
Wrote /Users/alastair/.emacs.d/.cask/24.3.1/elpa/archives/marmalade/archive-contents
Contacting host: melpa.milkbox.net:80
Saving file /Users/alastair/.emacs.d/.cask/24.3.1/elpa/archives/melpa/archive-contents...
Wrote /Users/alastair/.emacs.d/.cask/24.3.1/elpa/archives/melpa/archive-contents
View 99bob.cpp
#include <boost/mpl/assert.hpp>
#include <boost/mpl/at.hpp>
#include <boost/mpl/back_inserter.hpp>
#include <boost/mpl/copy.hpp>
#include <boost/mpl/divides.hpp>
#include <boost/mpl/empty_sequence.hpp>
#include <boost/mpl/equal.hpp>
#include <boost/mpl/equal_to.hpp>
#include <boost/mpl/fold.hpp>
#include <boost/mpl/for_each.hpp>