Skip to content

Instantly share code, notes, and snippets.

@mhhollomon
mhhollomon / Add-FX-to-Selected-Tracks.lua
Created May 22, 2023 13:04
REAPER - Lua ReaScript to add a particular plug in to the FX chains of the selected tracks
-- Change this to customize which plug-in is added.
local fx_name = "kHs Gain"
local tcount = reaper.CountSelectedTracks(0)
local tindex
local mtrack
local fx_pos
for tindex = 0, tcount-1 do
mtrack = reaper.GetSelectedTrack(0, tindex)
@mhhollomon
mhhollomon / vertical-zoom-to-fit.lua
Created May 21, 2023 23:18
Reaper DAW has a horizontal zoom-to-fit function for the timeline but not a vertical. This gist is a ReaScript Action that adds that missing functionality.
local script_name = ({reaper.get_action_context()})[2]:match("([^/\\_]+)%.lua$")
-- Note : Requires js_ReaScriptAPI extension to be installed
local w = reaper.JS_Window_Find( "trackview", true )
local retval, left, top, right, bottom = reaper.JS_Window_GetClientRect( w )
-- width = right - left
height = bottom - top
local SMALLEST = 40
local LARGEST = 100
@mhhollomon
mhhollomon / last-reaper-project.ps1
Created May 4, 2023 12:53
Simple powershell oneliner to open REAPER DAW with the last opened project according to WIndows.
Invoke-Item (Get-ChildItem $env:APPDATA\Microsoft\Windows\Recent\* -File -Filter *.rpp.lnk | Sort-Object -Property LastWriteTime)[-1].Fullname
#!/usr/bin/env node
//
// Updated for purgecss v2
//
'use strict;'
const Purgecss = require("purgecss");
const fs = require("fs");
@mhhollomon
mhhollomon / connect-vm.ps1
Created December 5, 2018 00:08
Integrate Virtual Box and Putty using Powershell
<#
.Synopsis
Start and connect to a VirtualBox headless VM
.Description
Given either the UUID or Name of a VirtualBox VM, the script will check if the
VM is running, start it if not, and then connect to it using PuTTY.
.Parameter Vmid
VM identifier. This can either be the UUID or the name.
/***********************************************
* Copyright 2018 Mark Hollomon
*
************************************************/
#include <iostream>
#include <string>
#include <cctype>
#include <boost/spirit/home/x3.hpp>
@mhhollomon
mhhollomon / parse_ident_v3.cpp
Last active September 17, 2018 22:35
Our final code
#include <iostream>
#include <string>
#include <boost/config/warning_disable.hpp>
#include <boost/spirit/home/x3.hpp>
//****************************
// The parser
//****************************
namespace x3 = boost::spirit::x3;
@mhhollomon
mhhollomon / parse_ident_v2.cpp
Last active September 17, 2018 22:36
A second improved attempt
#include <iostream>
#include <string>
#include <boost/config/warning_disable.hpp>
#include <boost/spirit/home/x3.hpp>
//****************************
// The parser
//****************************
namespace x3 = boost::spirit::x3;
@mhhollomon
mhhollomon / parse_ident_v1.cpp
Last active September 17, 2018 22:37
first attempt to parse identifiers
#include <iostream>
#include <string>
#include <boost/config/warning_disable.hpp>
#include <boost/spirit/home/x3.hpp>
//****************************
// The parser
//****************************
namespace x3 = boost::spirit::x3;