Skip to content

Instantly share code, notes, and snippets.

View acarabott's full-sized avatar

Arthur Carabott acarabott

View GitHub Profile
@acarabott
acarabott / get-big-photos.scpt
Created March 17, 2023 06:44
Applescript to get all files in Photos.app greater than a particular size
set threshold_in_megabytes to 500
set threshold_in_bytes to threshold_in_megabytes * 1000 * 1000
tell application "Photos" to return filename of media items whose size is greater than or equal to threshold_in_bytes
@acarabott
acarabott / logic-scripter-pitch-to-pan.js
Last active April 8, 2022 18:34
A Logic Pro X Scripter patch to map note pitch to panning
function mapLinear(value, inMin, inMax, outMin, outMax) {
if (value <= inMin) {
return outMin;
}
if (value >= inMax) {
return outMax;
}
const inRange = inMax - inMin;
const valueNorm = (value - inMin) / inRange;
@acarabott
acarabott / std-algorithms.md
Last active October 7, 2021 22:00
C++ std algorithm checklist

C++ Standard Library Algorithms (up to C++17)

A checklist of std algorithms, from https://en.cppreference.com/w/cpp/header/algorithm.

Non-modifying sequence operations

@acarabott
acarabott / iOSBuildIncrementer.cs
Created July 6, 2019 11:58
Unity iOS Build Number Incrementer
#if UNITY_EDITOR
using UnityEditor;
using UnityEditor.Callbacks;
using UnityEngine;
public static class iOSBuildIncrementer
{
[PostProcessBuild]
public static void OnPostprocessBuild(BuildTarget target, string pathToBuiltProject)
@acarabott
acarabott / encoding-video.md
Created June 10, 2018 18:28 — forked from Vestride/encoding-video.md
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
@acarabott
acarabott / contract.md
Created January 3, 2018 18:23 — forked from danhett/contract.md
A contract for creative technologist/development services.

This is simple, clear and concise contract that I use for general creative and technical projects. It's based largely upon Brendan Dawe's excellent open-source design contract, but has been modified to contain more appropriate terminology for my field, and now contains sections pertaining to source code, ongoing support, NDA's etc.

Please feel free to fork, modify, distribute and use this document as you wish - and please please do use it. Do not start work without a contract, ever. Additionally: DO NOT START WORK WITHOUT A CONTRACT, EVER.

Agreement for commission of work between:

Dan Hett ("Developer", "me", "I")

and:

[CLIENT NAME] ("Client", "you")

@acarabott
acarabott / freeagent-attachment.js
Last active November 24, 2017 11:36
FreeAgent - Auto click 'Add Attachment' link when reviewing bank statements
Array.from(document.getElementsByClassName('BankTransaction-description')).forEach(link => {
link.addEventListener('click', () => {
setTimeout(() => {
const buttons = Array.from(document.getElementsByClassName('inline_explain_attachment_add_button'));
if (buttons.length > 0) { buttons[0].click(); }
}, 500);
});
});
@acarabott
acarabott / faust-macos-homebrew.md
Last active February 27, 2021 23:36
Instructions for building Faust and FaustLive on macOS with Homebrew

Building Faust on macOS with Homebrew

If you haven't installed Homebrew get it from https://brew.sh/

Faust

git clone git@github.com:grame-cncm/faust.git
cd faust
@acarabott
acarabott / getstills
Created March 26, 2017 17:37
extract stills using ffmpeg
function getstills {
if [[ ! -z $1 ]]; then
OUT=${2:-.}
START=${3:-00:00:00}
DUR=${4:-99:59:59}
ffmpeg -skip_frame nokey -i $1 -vsync vfr -ss $START -t $DUR "$OUT/still-%02d.png"
else
echo "usage: getstills FILENAME START (hh:mm:ss) DURATION OUTPUT_PATH";
fi
}
[
{
"artist": "Bad Brains",
"title": "I Against I",
"year": "1986"
},
{
"artist": "Bad Brains",
"title": "Bad Brains",
"year": "1996"