Skip to content

Instantly share code, notes, and snippets.

View flipphillips's full-sized avatar

Flip Phillips flipphillips

View GitHub Profile
@realvjy
realvjy / ChoasLinesShader.metal
Last active July 11, 2024 12:40
Choas Lines - Metal Shader
// Lines
float hash( float n ) {
return fract(sin(n)*753.5453123);
}
// Slight modification of iq's noise function.
float noise(vector_float2 x )
{
vector_float2 p = floor(x);
vector_float2 f = fract(x);
@arkku
arkku / qmk_apple_fn.patch
Last active March 3, 2024 14:22
Patch for QMK firmware to add two keycodes for Apple Fn: KC_APFN simulates the key directly, whereas APFN_LAYER(x) works as MO(x) but also registers as holding down Apple Fn _when no other key is pressed_. APFN_KEY(x) is key x together with Apple Fn.
diff --git a/builddefs/common_features.mk b/builddefs/common_features.mk
index c976b8296d..335b432e78 100644
--- a/builddefs/common_features.mk
+++ b/builddefs/common_features.mk
@@ -108,6 +108,12 @@ ifeq ($(strip $(MOUSEKEY_ENABLE)), yes)
SRC += $(QUANTUM_DIR)/mousekey.c
endif
+ifeq ($(strip $(APPLE_FN_ENABLE)), yes)
+ OPT_DEFS += -DAPPLE_FN_ENABLE -DENABLE_APPLE_FN_KEY=1
@foone
foone / rptimage.py
Created September 19, 2020 04:11
RPT decoder for Super Mario 64 RPT textures from Super Mario 3D All-Stars
# To use:
# 1. extract the NCAs from the NSP (I used NSCB)
# 2. extract the contents of 5977df9d4848858cbde157c6723dd1de.nca
# 3. inside 1 [romfs]\rom\Stardust_JP\Textures you'll find texture_pack.cpio. Extract it (I uzed 7zip)
# 4. run this python 2.7 script in the directory with all the .rpt files. It'll create a out folder containing all the PNGs
import struct,glob,os,zlib
from PIL import Image
OUTDIR='out'
@flipphillips
flipphillips / clean_macos_downloads.sh
Last active July 19, 2020 19:13
cleans up SQL database of macOS downloads
#!/bin/bash
echo "Before..."
sqlite3 ~/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV* 'select LSQuarantineDataURLString from LSQuarantineEvent' | awk NF
echo "Churning..."
sqlite3 ~/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV* 'delete from LSQuarantineEvent'
sqlite3 ~/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV* 'vacuum LSQuarantineEvent'
echo "After..."
sqlite3 ~/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV* 'select LSQuarantineDataURLString from LSQuarantineEvent' | awk NF
echo "Done."
#!/bin/bash
# fix-beriah-flac.sh
# Bash shell script to fix tags in Book of Beriah flac zip
############
# WARNING! #
############
#
# USE OF THIS SCRIPT IS ENTIRELY AT YOUR OWN RISK!
@fauxpark
fauxpark / applefn.patch
Last active July 17, 2024 08:25
QMK Apple Fn
diff --git a/builddefs/common_features.mk b/builddefs/common_features.mk
index 18f8b0bbfc..4ef3e230e4 100644
--- a/builddefs/common_features.mk
+++ b/builddefs/common_features.mk
@@ -878,6 +878,10 @@ ifeq ($(strip $(JOYSTICK_ENABLE)), yes)
endif
endif
+ifeq ($(strip $(APPLE_FN_ENABLE)), yes)
+ OPT_DEFS += -DAPPLE_FN_ENABLE
@schlady
schlady / mathlm.service
Created November 11, 2015 16:07
systemd service file for Mathematica network license manager MathLM
[Unit]
Description=Mathematica network license manager
After=network.target
[Service]
ExecStart=/usr/sbin/mathlm -foreground -logfile /var/log/mathlm.log -pwfile /opt/Wolfram/MathLM/mathpass
Restart=always
[Install]
WantedBy=multi-user.target
@witt3rd
witt3rd / brew-sync.sh
Last active February 25, 2024 12:04 — forked from jpawlowski/brew-sync.sh
Sync Homebrew installations between Macs via Dropbox
#!/bin/bash
# Sync Homebrew installations between Macs via Dropbox
#
BREW="/usr/local/bin/brew"
# first get local settings
echo "Reading local settings ..."
rm -f /tmp/brew-sync.*
@radio412
radio412 / gist:2b117658f0a34b3f5a26
Created April 7, 2015 15:37
Export obj, dae, and stl files from Rhino 3d via layers, grouped as layers or as individual objects.
import os
import scriptcontext
import rhinoscriptsyntax as rs
print "//export run started/////////////"
# this function via mcneel/rhinoscriptsyntax
#https://github.com/mcneel/rhinoscriptsyntax/blob/master/Scripts/rhinoscript/layer.py
def layerNames(sort=False):
@SheffieldKevin
SheffieldKevin / movietracks.swift
Last active November 7, 2020 14:47
Playing with movie tracks using AVFoundation in Swift (command line version)
#!/usr/bin/env swift
import Foundation
import AVFoundation
if Process.arguments.count != 2 {
println("The first and only argument should be a full path to a movie or music file.")
exit(1)
}