Skip to content

Instantly share code, notes, and snippets.

View mattpetters's full-sized avatar

matt petters mattpetters

  • San Diego
  • 07:40 (UTC -07:00)
View GitHub Profile
@mattpetters
mattpetters / rename_stems.sh
Created November 6, 2023 06:56
Script to remove prefixes from Ableton stem exports -- usage: ./rename_stems.sh "MY_PROJECT PREFIX ABCDEF"
#!/bin/zsh
# Check if an argument was provided
if [ $# -eq 0 ]; then
echo "Usage: $0 prefix"
exit 1
fi
# Prefix to be removed (first argument)
PREFIX="$1"
#!/bin/bash
# Get information about all installed applications
system_profiler SPApplicationsDataType
exit 0
#!/bin/bash
# Define the directories
dirs=(
"/Library/Audio/Plug-Ins/Components"
"/Library/Audio/Plug-Ins/VST"
"/Library/Audio/Plug-Ins/VST3"
)
# Loop through the directories
#!/bin/bash
# Check if the input file is provided
if [ -z "$1" ]; then
echo "Usage: $0 <file>"
exit 1
fi
# Store the input file's path
input_file="$1"

How to Patch Envy Code R with Nerd Font Glyphs

The author @damieng did an amazing job with this font but expressly explains that it cannot be redistributed.

So in honoring that here is a little guide for bringing it into the new decade and patching it with Nerd Fonts.

https://github.com/ryanoasis/nerd-fonts#font-patcher

  1. Download the original:
@mattpetters
mattpetters / ConnectionType.ts
Last active December 5, 2022 07:28
TypeORM + TypeScript + Dataloader + Relay Spec (connections, pagination)
import { Connection, Edge } from 'graphql-relay'
import { ClassType, Field, ObjectType } from 'type-graphql'
import { PageInfo } from '../PageInfo'
export function ConnectionType<V>(EdgeType: ClassType<V>) {
// `isAbstract` decorator option is mandatory to prevent registering in schema
@ObjectType({ isAbstract: true, description: 'A connection to a list of items.'})
abstract class ConnectionClass implements Connection<V>{
// here we use the runtime argument
@mattpetters
mattpetters / writeOFDueSoonAndFlaggedToConsole.scpt
Created May 22, 2019 15:10
Writes Due Soon & flagged to console, I use it for easy copy paste to trello
tell application "OmniFocus"
tell front document
-- Get the list of tasks
set theDueTasks to every flattened task where its completed = false and due date is greater than (current date) and due date is less than (current date) + (7 * days)
set theFlaggedTasks to every flattened task where its flagged = true and completed = false
set dueCount to count of theDueTasks
set flagCount to count of theFlaggedTasks
if theDueTasks is not equal to {} then
set reportText to "Due soon:
"
while (sc.hasNextLine()){
String line = sc.nextLine();
if (line.isEmpty()){
continue;
} else {
String node = nextLine;
String anotherLine = sc.nextLine();
while (!anotherLine.isEmpty()) {
String[] neighborInfo = anotherLine.split("\\s+");
String neighborNode = neighborInfo[1];
$ wget http://downloads.sourceforge.net/project/glfw/glfw/3.0.1/glfw-3.0.1.zip
$ unzip glfw-3.0.1.zip
$ cd glfw-3.0.1/
$ mkdir build
$ cd build
$ export MACOSX_DEPLOYMENT_TARGET=10.8
$ cmake -D GLFW_NATIVE_API=1 -D CMAKE_OSX_ARCHITECTURES="i386;x86_64" -D BUILD_SHARED_LIBS=ON -D CMAKE_C_COMPILER=clang ../
$ make
$ ls -l src/libglfw*