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
<?php
/* USAGE EXAMPLE:
* $data = [
* 'key1' => [1, 1, 1, 1],
* 'key2' => [1, 1],
* ];
*
* $win = new Window(2);
* foreach($data as $key => $points)
* {
@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 / !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 / 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 / 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 / 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;
-- https://forum.cockos.com/showthread.php?t=200086
function solo(trackIndex)
local track = reaper.GetTrack(0, trackIndex)
if not track then return false end
reaper.PreventUIRefresh(1)
reaper.SoloAllTracks(0)
reaper.SetMediaTrackInfo_Value(track, 'I_SOLO', 1)
require 'json'
files = {}
d = File.open "test", &JSON.method(:load)
d.each {|r|
r['assets'].each {|a|
files[a['name']] ||= 0
files[a['name']] += a['download_count']
}