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
#ifndef EG_CMD_HPP_ | |
#define EG_CMD_HPP_ | |
#include <cstdint> | |
#include <utility> | |
#include <memory> | |
namespace Cmd { | |
// In my case there are many commands, so I am reducing the number of |
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
// 32-bit FNV-1a | |
// Will produce creepy output if input data is not ASCII | |
function fnv1a(str) { | |
var OFFSET_BASIS = 0x811c9dc5; | |
//var PRIME = 0x01000193; | |
var h = OFFSET_BASIS; | |
for (var i = 0; i < str.length; ++i) { |
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 <cstddef> | |
#include <stdexcept> | |
#include <utility> | |
#include <string> | |
#include <iomanip> | |
#include <sstream> | |
#include <iostream> | |
using String=std::string; |
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 <cstdint> | |
#include <type_traits> | |
#include <stdexcept> | |
#include <iostream> | |
using Unit = uint8_t; | |
using Point = uint32_t; | |
namespace utf8 { |
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
#ifdef _GLIBCXX_USE_CLOCK_MONOTONIC | |
/// steady_clock | |
struct steady_clock | |
{ | |
typedef chrono::nanoseconds duration; | |
typedef duration::rep rep; | |
typedef duration::period period; | |
typedef chrono::time_point<steady_clock, duration> time_point; | |
static constexpr bool is_steady = true; |
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/bash | |
# Usage: | |
# timelapse.sh root rate quality | |
# | |
# Join with something like: | |
# avconv -f image2 -r 15 -i "%05d.jpg" -r 24 -s 1680x1050 -vcodec mpeg4 -pix_fmt yuv420p -q 8 output.mp4 | |
# Root path |
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
struct P {}; | |
using C = P[]; | |
struct T { | |
C const& ref; | |
}; | |
union U { | |
T t; |
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 <cstddef> | |
using E = int; | |
using U = E[]; | |
struct H { | |
E b[1]{E{1}}; | |
U const& ref{reinterpret_cast<U const&>(b)}; | |
operator U const&() const { |
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 <cassert> | |
#include <new> | |
#include <iostream> | |
namespace { | |
template<typename... P> | |
struct sizeof_max_impl; | |
template<> |
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
// Unknown-purpose PLI format | |
// Overview | |
// 1. PLI format | |
// a. Layout | |
// b. Layer | |
// ***************************** | |
// 1. PLI format |