Skip to content

Instantly share code, notes, and snippets.

View tgockel's full-sized avatar

Travis Gockel tgockel

View GitHub Profile
#!/bin/sh
# Most containers do not have the sudo program installed, but this works well
# enough.
exec "$@"

Glossary

Directive

This is a test of using the glossary directive.

.. glossary::

Keybase proof

I hereby claim:

  • I am tgockel on github.
  • I am tgockel (https://keybase.io/tgockel) on keybase.
  • I have a public key whose fingerprint is 09F3 9016 6B20 BA4B 871C B209 6B77 60BB 7758 2F79

To claim this, I am signing this object:

@tgockel
tgockel / .zshrc
Last active April 11, 2017 16:03
Personal zshrc for storage reasons
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000
unsetopt beep
export MAKEFLAGS="-j9"
export PATH="${PATH}:/home/$(whoami)/Dropbox/bin"
alias dd-status-update='for x in $(pgrep -l "^dd$" | sed "s|^\([^ ]*\).*$|\1|"); do sudo kill -USR1 ${x}; done'
alias can-has='sudo zypper install'
/** \file crc32.cpp
* A number of implementations of a CRC32 algorithm. This program will only work on a CPU with SSE 4.2 support.
*
* Compile with:
*
* $> g++ --std=c++17 crc32.cpp -O3 -fwhole-program
*
* The output is a CSV file showing the timings of the various implementations.
**/
#include "random_seed.hpp"
int main()
{
// Just test that this compiles...not really sure what to do with these things
tgl::random_device_seed seed;
std::mt19937_64 mt_rng(seed);
std::minstd_rand lc_rng(seed);
std::ranlux48 lx_rng(seed);
}
@tgockel
tgockel / same_named_ctor_and_method.cpp
Last active July 15, 2016 02:02
Override method which has the same name as the class
/** \file
* This is an attempt to answer the Stack Overflow question "Override method
* which has the same name as the class," wherein I ask how one would go about
* implementing a virtual method of some derived type which happens to have the
* same name as the method I need to implement.
*
* http://stackoverflow.com/questions/38384075/
*
* Two methods are proposed, one using a typedef and the other using static
* polymorphism (see below for implementation). The conclusion is there are