Skip to content

Instantly share code, notes, and snippets.

@tancredi
tancredi / remade-cut.svg
Last active March 5, 2024 20:11
remade-cut
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tancredi
tancredi / downsize-assets.js
Created July 18, 2022 12:03
Downsize retina assets (Node.js) script
#!/usr/bin/env node
/* eslint-disable @typescript-eslint/no-var-requires */
const { join, basename, dirname } = require('path');
const Jimp = require('jimp');
const glob = require('fast-glob');
const color = require('cli-color');
@tancredi
tancredi / Pioneer DDJ-200 Alternative.midi.xml
Last active July 16, 2022 10:42
DDJ-200-alternative-mappings
<?xml version='1.0' encoding='utf-8'?>
<MixxxControllerPreset schemaVersion="1" mixxxVersion="2.0.0+">
<info>
<name>Pioneer DDJ-200 (Alternative)</name>
<author>Dan Giddins, Frank.Breitling at gmx.de, Geovanni Pacheco</author>
<description>2-deck USB and Bluetooth MIDI controller with support for 4-deck mode.</description>
<forum>https://mixxx.discourse.group/t/pioneer-ddj-200-mapping/18259</forum>
<manual>pioneer_ddj_200_alternative</manual>
</info>
<controller id="DDJ-200 ALT">
@tancredi
tancredi / resize
Created July 15, 2022 12:29
Image resize script
#!/usr/bin/env node
const color = require('cli-color');
const Jimp = require('jimp');
const [inputFile, resizeInput, outputFile] = process.argv.slice(2);
const usage = () => {
console.log(
color.red(
@tancredi
tancredi / game-controller-sampler.hid.js
Created December 25, 2021 19:41
Custom joystick as sampler controls - Mixxx HID controller mappings
const GC = {
stopOnRelease: false,
};
const MAP = {
TOP_L: [6, 1], // 0, 1
TOP_R: [6, 2], // 1, 2
TRIGGER_L: [6, 4], // 2, 4
TRIGGER_R: [6, 8], // 3, 8
@tancredi
tancredi / griffin-powermate-library-control.hid.js
Created December 25, 2021 03:43
Griffin PowerMater as library wheel & preview button - Mixxx HID controller mappings
const THROTTLE = 50;
const GPM = { lastMove: null, previewToMiddleOnLoad: false };
const GROUPS = { PREVIEW: "[PreviewDeck1]" };
const MAX_POSITION = 1.14;
GPM.init = function (id) {
GPM.controller = new HIDController();
GPM.id = id;
GPM.registerInputPackets();
GPM.registerOutputPackets();
@tancredi
tancredi / midi-ino.ino
Last active December 25, 2021 03:37
MIDI-Ino - An Arduino custom MIDI controller with Mixxx mappings
#include <USB-MIDI.h>
USBMIDI_CREATE_DEFAULT_INSTANCE();
const float K_MAX = 690;
const float K_THRESHOLD = 1;
const byte K_PINS[5]= { A0, A1, A2, A3, A4 };
const byte L_PINS[5]= { 2, 3, 4, 5, 6 };
const byte B_PINS[5]= { 9, 10, 11, 12, 13 };
@tancredi
tancredi / griffin-powermate-fx-knob.hid.js
Last active December 22, 2021 15:23
Griffin PowerMater as FX knob - Mixxx HID controller mappings
const GPM = { friction: 10, deck: 0 };
GPM.init = function (id) {
GPM.controller = new HIDController();
GPM.id = id;
GPM.controller.activeDeck = 1;
GPM.registerInputPackets();
GPM.registerOutputPackets();
GPM.registerCallbacks();
};
@tancredi
tancredi / tooltip.stylus
Created October 24, 2013 10:03
Stylus mixin for creation of tooltips with pure CSS tail. Will use the `background-color`, `border-width` and `border-color` properties of the parent element to work out how to define and style the pseudo elements. All you will have to specify is the tail direction and size
tooltip-tail(direction = bottom, color = black, size = 10px)
if direction is bottom
dir = 'top'
top 100%
left 50%
margin-left ( - size )
else if direction is top
dir = 'bottom'
@tancredi
tancredi / package-version-bump.sh
Last active January 17, 2021 17:39
Semver bump-tag-commit
#!/usr/bin/env bash
set -e
###
# Bump and tag a Node.js module
#
# Assuming 'x.x.x' semver format automatically parses the current package.json
# version, bumps it depending on provided major / minor / patch strategy,
# overrides the 'version' field on the package.json file, adds a git tag and