Skip to content

Instantly share code, notes, and snippets.

@cfillion
cfillion / converter.rb
Last active December 23, 2015 01:08
Batch header converter for ReaScripts
DEFAULT_VERSION = '0.1'.freeze
PREFIX = ' * '.freeze
INDENT = "\x20" * 2
LOG_REGEX = /
\s*(?:(?:--)?\]\]|\*\/)
(.+
Changelog\s*:\n
(.+?)\n\s*
@cfillion
cfillion / AddRemoveReaScript_Test.lua
Last active January 28, 2016 08:12
Test for the new AddRemoveReaScript API function added in REAPER v5.12
FILE_COUNT = 1
function generateFiles()
local files = {}
for index=1, FILE_COUNT do
files[index] = string.format("%s/Scripts/DUMMY_%02d.lua", reaper.GetResourcePath(), index)
end
return files
@cfillion
cfillion / jnetlib_get.cpp
Last active March 16, 2019 06:20
Simple command-line HTTP-only downloader using JNetLib
// DEPENDENCIES:
// WDL from https://cockos.com/wdl/
//
// BUILD INSTRUCTIONS:
// Windows:
// - SET WDL=path/to/WDL
// - cl /O2 /I%WDL% jnetlib_get.cpp %WDL%/WDL/jnetlib/httpget.cpp %WDL%/WDL/jnetlib/util.cpp %WDL%/WDL/jnetlib/connection.cpp %WDL%/WDL/jnetlib/asyncdns.cpp Ws2_32.lib
// - jnetlib_get.exe http://google.com/
//
// macOS & Linux
<?php
/* USAGE EXAMPLE:
* $data = [
* 'key1' => [1, 1, 1, 1],
* 'key2' => [1, 1],
* ];
*
* $win = new Window(2);
* foreach($data as $key => $points)
* {
@cfillion
cfillion / !travis-reapack-index-deploy.md
Last active January 14, 2017 12:25
Setting up travis to check and update index.xml using reapack-index

Instructions

  1. Generate a new ssh key without a passphrase:
    ssh-keygen -t rsa -b 4096 -f deploy_key -C 'travis index bot'
    
  2. Encrypt the generated key with a unique, secure passphrase:
gpg -c deploy_key
@cfillion
cfillion / macpassmenu
Created January 8, 2017 11:53
Port of passmenu for macOS using cfillion/cpmenu and cliclick
#!/usr/bin/env bash
# Forked from https://git.zx2c4.com/password-store/tree/contrib/dmenu/passmenu
shopt -s nullglob globstar
typeit=0
if [[ $1 == "--type" ]]; then
typeit=1
shift
@cfillion
cfillion / win32-rugged.sh
Last active January 16, 2017 06:24
Build rugged on Windows
gem install rake-compiler
C:\Ruby23\DevKit\devkitvars.bat
bundle exec rake clean clobber native gem
C:\Ruby23-x64\bin\setrbvars.bat
C:\Ruby23-x64\DevKit\devkitvars.bat
bundle exec rake clean clobber native gem
@cfillion
cfillion / userChrome.css
Last active November 18, 2017 03:58
My custom `profile_root/chrome/userChrome.css` file for tab numbering in Firefox
@namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
tab {
counter-increment: tabnumber;
}
.tabbrowser-tab:not([pinned]):not([selected]):before {
background: none !important;
color: black !important;
content: "\A0\A0" counter(tabnumber) !important;
@cfillion
cfillion / lambda-self-destruct-demo.cpp
Last active February 7, 2017 18:46
What in the world was causing that crash?! I finally figured it out...
// build with `cl /nologo /W3 /WX /EHsc /MT /O2 /Z7 /Zo main.cpp`
#include <functional>
static const size_t QUANTITY = 2555;
struct Obj
{
std::function<void ()> func;
};
@cfillion
cfillion / reaper-www-toolbar.html
Last active September 17, 2022 23:51
Simple web interface example for running REAPER actions remotely https://i.imgur.com/ZhC3vF4.gif
<!DOCTYPE html>
<html>
<head>
<title>Toolbar demo by cfillion</title>
<meta charset="utf-8"/>
<style>
@font-face {
font-family: 'Bravura';
src: url('https://cdn.rawgit.com/openlilylib/openlilylib/3d6a145a/custom-music-fonts/smufl/bravura-1.12/woff/Bravura.woff');
}