Instantly share code, notes, and snippets.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
html, | |
body { | |
padding:0; | |
margin:0; | |
height:100%; | |
} | |
body { | |
color: white; | |
background:#777; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
{ | |
"$schema":"http://json-schema.org/draft-07/schema#", | |
"additionalProperties":false, | |
"definitions": { | |
"EventApiResponseMeta": { | |
"additionalProperties":false, | |
"description":"An object that represents metadata related to this event.", | |
"properties": { | |
"apiVersion": { | |
"description":"Api version.", |
cowboy /route-search.sh
Last activeAugust 16, 2024 11:30
Elite: Dangerous, Trade Dangerous wrapper script This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
userprofile_dir=$(wslpath"$(wslvar USERPROFILE)") | |
journal_dir="$userprofile_dir/Saved Games/Frontier Developments/Elite Dangerous" | |
status_file="$journal_dir/Status.json" | |
journal_credits=$(cat"$status_file"| jq -r .Balance) | |
[["$journal_credits"== null ]]&& journal_credits=999999999 | |
# journal_system_id=$(cat "$status_file" | jq -r .Destination.System) | |
# journal_system_name=$(curl -s https://spansh.co.uk/api/system/$journal_system_id | jq -r .record.name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
// To give your project a unique name, this code must be | |
// placed into a .c file (its own tab). It can not be in | |
// a .cpp file or your main sketch (the .ino file). | |
#include"usb_names.h" | |
// Edit these lines to create your own name. The length must | |
// match the number of characters in your custom name. | |
#defineMIDI_NAME {'S','y','n','c','a','t','r','o','n'} |
cowboy /name_of_script.cmd
Last activeJuly 3, 2024 09:37
bash script in a Windows cmd file, so you can double-click and run right from Explorer This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
:<<"::CMDLITERAL" | |
@echooff | |
FOR /F"tokens=* USEBACKQ"%%FIN (`wsl wslpath '%~f0'`)DO ( | |
SETscript_path=%%F | |
) | |
bash -c"'%script_path%'" | |
exit /b | |
::CMDLITERAL | |
SCRIPT_DIR=$(cd --"$(dirname --"${BASH_SOURCE[0]}")"&> /dev/null&& pwd) |
cowboy /usb-din-midi-device.c
Last activeDecember 11, 2023 08:44
USB MIDI device -> filter -> DIN MIDI out - for Teensy LC This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
// To give your project a unique name, this code must be | |
// placed into a .c file (its own tab). It can not be in | |
// a .cpp file or your main sketch (the .ino file). | |
#include"usb_names.h" | |
// Edit these lines to create your own name. The length must | |
// match the number of characters in your custom name. | |
#defineMIDI_NAME {'R','e','n','a','m','e',' ','M','e',' ','D','u','d','e'} |
cowboy /cowboy-launchkey-mini-mk3-supercharger.c
Last activeJuly 27, 2023 04:37
Launchkey Mini MK3 Supercharger (USB MIDI) - for Teensy 4.1 This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
// To give your project a unique name, this code must be | |
// placed into a .c file (its own tab). It can not be in | |
// a .cpp file or your main sketch (the .ino file). | |
#include"usb_names.h" | |
// Edit these lines to create your own name. The length must | |
// match the number of characters in your custom name. | |
#defineMIDI_NAME {'C','B',' ','S','u','p','e','r',' ','L','a','u','n','c','h','k','e','y'} |
cowboy /teensy-41-usbmidi-issue
CreatedAugust 23, 2022 04:36
Teensy 4.1 USB MIDI issue: note on/off messages get dropped when enough keys are pressed/released simultaneously (MIDI controller connected to USB host port, PC running MIDI OX connected to micro USB port) This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
// Settings: | |
// Tools > Board = "Teensy 4.1" | |
// Tools > USB Type to "MIDI" | |
#include <USBHost_t36.h> // access to USB MIDI devices (plugged into 2nd USB port) | |
// Create the ports for USB devices plugged into Teensy's 2nd USB port (via hubs) | |
USBHost myusb; | |
USBHub hub1(myusb); | |
MIDIDevice midiDevice(myusb); |
cowboy /cowboy-midi-sustain-filter.c
Last activeDecember 22, 2023 21:51
USB MIDI "proxy" that converts Note On + Sustain + Note Off => Note On + "Sustained" Note Off for devices that don't handle Sustain (CC 64) well This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
// To give your project a unique name, this code must be | |
// placed into a .c file (its own tab). It can not be in | |
// a .cpp file or your main sketch (the .ino file). | |
#include"usb_names.h" | |
// Edit these lines to create your own name. The length must | |
// match the number of characters in your custom name. | |
#defineMIDI_NAME {'C', 'o', 'w', 'b', 'o', 'y', ' ', 'F', 'i', 'l', 't', 'e', 'r'} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
// =============================================================== | |
// Misc utilities for OpenSCAD | |
// 2022 "Cowboy" Ben Alman | |
// | |
// https://gist.github.com/cowboy/0a536021bcf1d07b2a59e808dcddd278 | |
// =============================================================== | |
// Epsilon value for merging solids | |
eps=0.001; |
NewerOlder