Skip to content

Instantly share code, notes, and snippets.

View McMartin's full-sized avatar

Alain Martin McMartin

View GitHub Profile
# Copyright (c) 2017 Alain Martin
#
# 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
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# Copyright (c) 2017 Alain Martin
#
# 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
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
@McMartin
McMartin / projects.txt
Last active February 1, 2019 13:01
Projects to add to FRUT/generated
https://github.com/balandinodidonato/MyoMapper
https://github.com/bassjansson/basslive/tree/v3.0/master
https://github.com/jonathonracz/AudioFilePlayerPlugin
https://git.iem.at/audioplugins/IEMPluginSuite
@McMartin
McMartin / fizzbuzz.cmake
Last active May 9, 2018 22:09
A CMake test framework heavily inspired by doctest (https://github.com/onqtam/doctest)
function(get_fizzbuzz in out)
math(EXPR off3 "${in} % 3")
math(EXPR off5 "${in} % 5")
if(NOT off3 AND NOT off5)
set(${out} FizzBuzz PARENT_SCOPE)
elseif(NOT off3)
set(${out} Fizz PARENT_SCOPE)
elseif(NOT off5)
set(${out} Buzz PARENT_SCOPE)
@McMartin
McMartin / fizzbuzz.cmake
Last active February 6, 2018 22:23
A CMake test framework heavily inspired by Qt Quick Test (http://doc.qt.io/qt-5/qtquick-qtquicktest.html)
function(get_fizzbuzz in out)
math(EXPR off3 "${in} % 3")
math(EXPR off5 "${in} % 5")
if(NOT off3 AND NOT off5)
set(${out} FizzBuzz PARENT_SCOPE)
elseif(NOT off3)
set(${out} Fizz PARENT_SCOPE)
elseif(NOT off5)
set(${out} Buzz PARENT_SCOPE)

Implementations of the Action-Model-View pattern:

  • with PDCurses
  • with Win32
#include "QtEventLoop.hpp"
#include <QApplication>
#include <QDebug>
#include <QKeyEvent>
#include <QLabel>
#include <QMainWindow>
#include <functional>
#include "Model.hpp"
#include "QtEventLoop.hpp"
#include <QApplication>
#include <QDebug>
#include <QKeyEvent>
#include <QLabel>
#include <functional>
@McMartin
McMartin / read-dls.py
Last active July 10, 2024 00:36
Read DLS file using Python
import struct
import sys
from chunk import Chunk
FOURCC_DLS = b'DLS '
FOURCC_DLID = b'dlid'
FOURCC_COLH = b'colh'
FOURCC_WVPL = b'wvpl'
@McMartin
McMartin / min-self-tokenize.cmake
Last active May 15, 2018 21:25
A CMake script that reads itself and emits tokens
cmake_policy(VERSION ${CMAKE_VERSION})
function(print_token type text line column)
if(column LESS 10)
set(column "0${column}")
endif()
string(REGEX REPLACE "\n" "\\\\n" text "${text}")