Skip to content

Instantly share code, notes, and snippets.

View willkill07's full-sized avatar
🏠
Working from home

Will Killian willkill07

🏠
Working from home
View GitHub Profile
@willkill07
willkill07 / gist:377ea99ed01f44f0cb37
Created April 4, 2015 21:15
goto in bash (with reverse seeking)
#!/bin/bash
# include this boilerplate
function jumpto
{
label=$1
cmd=$(sed -n "/#$label:/{:a;n;p;ba};" $0)
eval "$cmd"
exit
}
start=${1:-"start"}
@willkill07
willkill07 / stack.hpp
Created February 22, 2015 02:27
C++11 stack implemented with std::forward_list
#include <forward_list>
template <typename Type, typename Allocator = std::allocator <Type>, typename SizeType = std::size_t>
class
stack
{
public:
using value_type = Type;
using allocator_type = Allocator;
using reference = value_type &;
@willkill07
willkill07 / memtrace.cpp
Last active August 29, 2015 14:15
Memory Trace C++11
#include <array>
#include <functional>
#include <iostream>
#include <new>
#include <type_traits>
#include <vector>
#define M 2
#define N 4
#define P 2
int main()
{
auto t = make_scoped(
task(
[] (auto x) {
}, token,
then(
[] (auto x) {