Skip to content

Instantly share code, notes, and snippets.

View HertzDevil's full-sized avatar
⚒️

Quinton Miller HertzDevil

⚒️
View GitHub Profile
@HertzDevil
HertzDevil / chain_int.hpp
Created February 24, 2017 08:16
chained integer
#pragma once
#include <cstdint>
#include <type_traits>
#include <utility>
namespace {
template <bool Signed>
using minint = std::conditional_t<Signed, int8_t, uint8_t>;
@HertzDevil
HertzDevil / auto_test.cpp
Last active December 17, 2017 11:45
begin/end
#include <type_traits>
#include <iostream>
#include <vector>
#include <tuple>
#include <algorithm>
namespace detail {
template <typename...>
using void_t = void;
@HertzDevil
HertzDevil / proj_for.cpp
Last active October 17, 2017 06:28
proj_for
#include <iostream>
#include <memory>
#include <vector>
#include <utility>
#include <type_traits>
namespace details {
template <typename T>
constexpr auto begin_expr(T&& x) {
@HertzDevil
HertzDevil / y.lua
Created November 19, 2017 22:14
lua y combinator
#!/usr/bin/env lua
-- recursive
local multiply0; multiply0 = function (x, y, z)
if x == 0 then return z end
return multiply0(x - 1, y, z + y)
end
-- explicit function argument, normal
local multiply1 = function (f, x, y, z)
@HertzDevil
HertzDevil / ntrq.lua
Created December 14, 2017 08:24
basic fceux mouse support for ntrq
--[[
features supported right now:
- clicking any of the 7 main windows moves the cursor there
- clicking any field moves the cursor there directly (except frame editor and pattern editor)
tested on ntrq v1.9 ntsc only
]]
local isHeld, isPressed, isReleased, pollKeys, getMousePos, isMouseValid; do
local keys = {}
@HertzDevil
HertzDevil / enum_traits.hpp
Last active December 25, 2023 06:31
safer enums in c++
#pragma once
#include <type_traits>
#include <limits>
// The default enumeration category. Conversion is equivalent to static_cast.
// Unspecialized enumeration traits use this category.
struct enum_default { };
// The standard-layout enumeration category. Values outside the given range are
@HertzDevil
HertzDevil / array_view.h
Created January 15, 2018 07:23
array view
#pragma once
#include <iterator>
#include <limits>
#include <string>
#include <array>
template <typename T>
class array_view {
public:
@HertzDevil
HertzDevil / kraid.json
Created March 10, 2018 18:21
kraid.json
{
"global": {
"detune": 0.0,
"engine_speed": 0,
"fxx_split_point": 32,
"linear_pitch": false,
"machine": "ntsc",
"refresh_rate": 60,
"vibrato_style": "new"
},
@HertzDevil
HertzDevil / feh_enemies.tsv
Created July 13, 2018 18:49
FEH Enemy Stat Table
Name Map Lv * HP Atk Spd Def Res
??? S1103 22 3 23 17 21 12 14
??? S1004 23 4 24 19 23 13 16
??? S1205 25 4 25 20 24 14 17
??? S1401 26 3 25 19 23 14 16
??? S1305 27 4 32 21 26 15 17
??? S1405 31 4 32 25 29 19 22
??? S1103 32 4 28 23 29 17 20
??? S1401 32 4 28 23 29 17 20
??? S1004 33 5 30 25 31 19 22
<!-- MID_MARIABELL_HOME1 -->
{{OtherLanguages
|english=Sharena is quite good humored, don't\nyou agree? Perhaps I'll invite her and\nLissa both for tea...
|japanese=シャロンさんってとても気さくですのね。\n今度お茶会にお誘いしたいですわ…\n当然、リズと貴方も一緒ですわよ。
|german=Sharena hat eine fröhliche Art, findet\nIhr nicht auch? Vielleicht werde ich\nsie und Lissa zum Tee einladen...
|spanishEU=Sharena es muy alegre, ¿verdad?\nCreo que la invitaré a tomar el té...,\ny a Lissa también.
|spanishLA=Sharena es muy alegre, ¿verdad?\nCreo que la invitaré a tomar el té...\nY a Lissa también.
|french=Sharena est vraiment charmante, ne\ntrouvez-vous pas ? Je vais peut-être\nl'inviter à prendre le thé avec Lissa...
|italian=Sharena è una persona deliziosa, non\ntrovi? Forse dovrei invitare lei e Lissa\nper un tè...
|chineseTW=夏蓉小姐真是平易近人呢。\n真想邀請她下次一起喝茶……\n當然,我也會邀請您和莉茲喔。