This file contains 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 -x | |
search="$@" | |
vlc_options=":sout=#transcode{vcodec=none,scodec=none}:http{mux=ogg,dst=:8080/} :no-sout-all :sout-keep" | |
youtube-dl "ytsearch1:$search" -r 200k -f 'bestaudio[ext=m4a]' -o - | cvlc - ${vlc_options} |
This file contains 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
enum class Kind : unsigned int; | |
struct Base { | |
const Kind kind; | |
explicit Base(Kind kind) : kind(kind) {} | |
template <class T> bool is() const { return kind == T::kind; } | |
template <class T> const T* cast() const { return is<T>()? static_cast<const T*>(this) : nullptr; } | |
}; |
This file contains 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 <boost/icl/interval_map.hpp> | |
#include <boost/optional.hpp> | |
#include <iostream> | |
using namespace boost::icl; | |
template <class Type> | |
struct inplace_overwrite : identity_based_inplace_combine<Type> { | |
void operator()(Type &object, const Type &operand) const { object = operand; } | |
}; |
This file contains 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 <type_traits> | |
#include <llvm/ADT/STLExtras.h> | |
struct Base { virtual ~Base() = default; }; | |
bool traverse( const Base* base, llvm::function_ref<bool(const Base*)> ); | |
struct dispatcher { | |
template <class F, class U, class... Args> | |
auto operator()( F &&f, U &&u, Args&&... args ) const { |
This file contains 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 <tuple> | |
#include <type_traits> | |
enum class A { | |
a, b | |
}; | |
enum class B { | |
c, d | |
}; |
This file contains 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 <memory> | |
#include <tuple> | |
#include <algorithm> | |
#include <experimental/array> | |
#include <type_traits> | |
namespace { | |
// This fails to evaluate if any element in Args is not a valid type. | |
// Otherwise it evaluates to void. |
This file contains 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/gnuplot | |
# Output format | |
set terminal png enhanced font "freesans,16" linewidth 2 | |
# Caption | |
set key inside top horizontal nobox font ",12" | |
set xlabel '' | |
set ylabel '' | |
set auto x |
This file contains 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 <algorithm> | |
#include <cstring> | |
#include <string> | |
#include <limits> | |
// Literal for the IEC Mebi binary prefix | |
static | |
std::string operator""_Mi( unsigned long long value ) { | |
struct Generator { | |
Generator( unsigned long long value ) : |
This file contains 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 SAX_H | |
#define SAX_H | |
#include <nlohmann/json.hpp> | |
#include <bitset> | |
#include <string_view> | |
#include <sstream> | |
template < class T > | |
struct sax_reader; |
This file contains 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 <array> | |
#include <tuple> | |
#include <string_view> | |
#include <utility> | |
template < class CharT, CharT... cs > | |
struct Literal { | |
static bool match( std::basic_string_view<CharT> s ) { | |
static constexpr std::array<CharT,sizeof...(cs)> value{cs...}; | |
return std::equal(value.begin(), value.end(), s.begin(), s.end()); |
NewerOlder