This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright Chris Smeele 2018. | |
// Distributed under the Boost Software License, Version 1.0. | |
// (See accompanying file LICENSE_1_0.txt or copy at | |
// http://www.boost.org/LICENSE_1_0.txt) | |
/* | |
* The machine spirits are willing. | |
*/ | |
#include <mpl/mpl.hpp> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <mpl/mpl.hpp> | |
using namespace kvasir::mpl; | |
struct fizz{}; | |
struct buzz{}; | |
struct fizzbuzz{}; | |
template<typename C = identity> | |
using fizzbuzzed = make_int_sequence< |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define die(...) \ | |
do { \ | |
fprintf(stderr, "[error] %s:%d: ", __FILE__, __LINE__); \ | |
fprintf(stderr, __VA_ARGS__); \ | |
fprintf(stderr, "\n"); \ | |
exit(1); \ | |
} while (0) | |
#define printd(...) \ | |
do { \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define-macro generator | |
(lambda (params . body) | |
(let ((cont (gensym "gen-cont")) | |
(yieldc (gensym "gen-yield"))) | |
`(lambda ,params | |
(let ((,cont #f)) | |
;; cont will point to the last yield call. | |
(lambda () | |
(let/cc ,yieldc | |
;; yieldc returns from the generator. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* \file | |
* \brief C++-ish sort-of switch statement reimplementation. | |
* \author Chris Smeele | |
* | |
* Copyright (c) 2017, Chris Smeele | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use 5.12.0; | |
use warnings; | |
my $pname = $ARGV[0] // die "usage: $0 NAME\n"; | |
for (my $i = 0;; ++$i) { | |
state @pids; | |
chomp(my @new_pids = `pgrep $pname`); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* \file | |
* \brief Due / sam3x8e native SPI. | |
* \author Chris Smeele | |
* \date 2016-10-09 | |
* \copyright Copyright (c) 2016, Chris Smeele | |
* | |
* Distributed under the Boost Software License, Version 1.0. | |
* (See accompanying file LICENSE_1_0.txt or copy at | |
* http://www.boost.org/LICENSE_1_0.txt) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* \file hwlib-glcd-oled-spi.hpp | |
* \brief SPI OLED driver for 128x64 screens. | |
* \author Chris Smeele | |
* \copyright Copyright (c) 2016, Chris Smeele | |
* \date 2016-10-06 | |
* | |
* Distributed under the Boost Software License, Version 1.0. | |
* (See accompanying file LICENSE_1_0.txt or copy at | |
* http://www.boost.org/LICENSE_1_0.txt) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
# This adds the post-inc, post-dec, pre-inc and pre-dec operators to python! | |
# Additionally, it supports the -O3 optimization feature. | |
my $optimized = 0; | |
if (@ARGV and $ARGV[0] eq '-O3') { | |
shift; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
pkill -x xcape | |
# Begin met een standaard US layout als basis. | |
setxkbmap us | |
# - Snelle toegang tot accenten etc. in level3 via rechter Alt. | |
# - Compose toets voor alle andere combinaties. | |
# - Ik ben vergeten waarom ik de laatste in de lijst heb en wat die doet. |