Skip to content

Instantly share code, notes, and snippets.

View bastih's full-sized avatar
Working from home

Sebastian Hillig bastih

Working from home
View GitHub Profile
View gist:5e737e8ceb65695db7f309ed5a9fbade
### Keybase proof
I hereby claim:
* I am bastih on github.
* I am bastih ( on keybase.
* I have a public key ASCp-2LNJOtKuUYKBX2HTUDz4TXIvhf0_TeyPmlxQ1yDPgo
To claim this, I am signing this object:
bastih /
Last active January 3, 2016 11:28
fast dev env setup for hyrise
sudo apt-get -y install sphinx-common emacs24-nox gdb valgrind tmux zsh perl ruby python-virtualenv
sudo apt-get -y --no-install-recommends install doxygen graphviz
git clone git:// ~/.scm_breeze
curl -L | sudo perl - App::cpanminus
sudo cpanm Term::ANSIColor Getopt::ArgvFile Getopt::Long Regexp::Common
View gist:5947369
template <
typename kT,
typename vT,
typename comp=typename std::map<kT, vT>::key_compare,
typename alloc=alloc_adapter<typename std::map<kT, vT>::value_type>
using map = std::map<kT, vT, comp, alloc>;
bastih / gist:5890712
Created June 29, 2013 10:47
Strong typing example
View gist:5890712
#include <boost/operators.hpp>
// Mostly inspired by boosts strong typedef, but without the macros
// Resulting type is ordered just like the wrapped type
template <typename T>
class strong_typedef : boost::totally_ordered1<strong_typedef<T>, boost::totally_ordered2<strong_typedef<T>, T>> {
strong_typedef() = default;
strong_typedef(const strong_typedef & t_) :
View gist:5804733
cmake_minimum_required(VERSION 2.8)
project(bencho C CXX)
find_library(PAPI NAMES papi)
bastih / gist:4643077
Created January 26, 2013 16:13
C++ never seizes...
View gist:4643077
struct A {
template <bool b>
void foo () {}
template<class T >
struct B {
void foo() {
T t;<false>(); // fix via: t.template foo<false>();
bastih / test.cpp
Created December 11, 2012 16:52
View test.cpp
#include <vector>
#include <string>
#include <iostream>
enum class clt {
class ColumnMetadata {
View gist:4154086
module ListPoint = struct
type point = int list
let make x y = [x; y]
let getX p = List.nth p 0
let getY p = List.nth p 1
let origin = [0; 0]
let print p = print_int (getX p); print_string " "; print_int (getY p); print_endline ""
module Square = struct
bastih / test.bash
Created September 11, 2012 23:25
Slightly scary
View test.bash
set +H
path=`find src/ -type f`
ssed -i "s/using namespace std;//" $path;
ssed -i "s/using std::.*//" $path;
# std-ize templates
for symbol in stack map list vector queue set pair priority_queue make_shared dynamic_pointer_cast numeric_limits back_insert_iterator
View some.cpp
inline uint64_t rdtsc() {
uint32_t lo, hi;
__asm__ __volatile__ (
"xorl %%eax, %%eax\n"
: "=a" (lo), "=d" (hi)
: "%ebx", "%ecx");
return (uint64_t)hi << 32 | lo;