Skip to content

Instantly share code, notes, and snippets.

@mpalpha
mpalpha / mousebtn2joy.ahk
Created January 16, 2023 23:57
auto hotkey script to mirror mouse clicks to joystick buttons 1, 2, and 3 (configurable)
; Change these values to use joystick button numbers other than 1, 2, and 3 for
; the left, right, and middle mouse buttons. Available numbers are 1 through 32.
; Use the Joystick Test Script to find out your joystick's numbers more easily.
ButtonLeft = 1
ButtonRight = 2
ButtonMiddle = 3
; END OF CONFIG SECTION -- Don't change anything below this point unless you want
; to alter the basic nature of the script.
@mpalpha
mpalpha / FB Alpha 2012.rmp
Last active April 18, 2024 04:35
RetroArch keybind config for Arcade1up's Killer Instinct
# final burn alpha 2012 remap for retroarch on Arcade1up's Killer Instinct
# retroarch/config/remaps/FB Alpha 2012/FB Alpha 2012.rmp
input_libretro_device_p1 = "5"
input_libretro_device_p2 = "5"
input_player1_analog_dpad_mode = "0"
input_player1_btn_a = "9"
input_player1_btn_b = "1"
input_player1_btn_x = "8"
input_player1_btn_y = "0"
input_player2_analog_dpad_mode = "0"
@mpalpha
mpalpha / klipper.cfg
Created December 14, 2021 03:56
klipper config for Creativity ELF - raspberry pi 4 + dragonfly BMS hotend + orbiter 1.5 + 5x TMC2209 (uart) + FYSTEC black pei magnetic bed + bltouch no-deploy abl + internal serial pi4 connection.
[input_shaper]
shaper_type_y: ei
shaper_freq_y: 47.8
shaper_type_x: 2hump_ei
shaper_freq_x: 60.8
shaper_type: mzv
[static_digital_output reset_display]
pins: !PC6, !PD13 # disable unsupported display
@mpalpha
mpalpha / macro_search_vars.cfg
Last active October 4, 2023 04:01
klipper macro to search for variables.
# This macro will allow you to type search_vars s={some word} from the terminal and
# it will respond with all of the matching items in the printer Object.
# Say I wanted to know what the name and path of for the value of the currently loaded bed
# mesh. I could do type search_vars s=profile in my terminal and it will respond with
# any items containing the word ‘profile’.
#
# $ SEARCH_VARS s="profile"
# // printer.bed_mesh.profile_name : default
#
[gcode_macro SEARCH_VARS]
@mpalpha
mpalpha / printer.cfg
Last active January 12, 2022 23:38
klipper config for Creativity ELF - raspberry pi 4 + dragonfly BMS hotend + orbiter + 5x TMC2209 (uart) + FYSTEC black pei magnetic bed + abl via mini ir sensor (by david crocker)
[input_shaper]
shaper_type_y: ei
shaper_freq_y: 47.8
shaper_type_x: 2hump_ei
shaper_freq_x: 60.8
shaper_type: mzv
[static_digital_output reset_display]
pins: !PC6, !PD13 # disable unsupported display
@mpalpha
mpalpha / readme.md
Created August 18, 2021 22:31
git clone and cd into

Installation

You can add the gcd script to your local bin path or you can add the followin snippet to your bash .profile or zsh .zshrc file.

function gcd {
  REPO=$1
  CLONEPATH=$2

 if [ -z $CLONEPATH ]; then
@mpalpha
mpalpha / tailwind.config.js
Created July 13, 2021 15:40
tailwindcss: include google font family plugin
// tailwind.config.js
const plugin = require('tailwindcss/plugin');
module.exports = {
theme: {
fontFamily: {
sans: ['Roboto Condensed'],
},
},
plugins: [
plugin(({ addBase }) => {
@mpalpha
mpalpha / tailwind.plugin.peer.js
Last active July 1, 2021 15:12
tailwind peer pseudo variants extracted for use in tailwindcss v2.2 outside of jit mode. (warning: use a parser, this can inflate your css)
// from https://blog.tailwindcss.com/tailwindcss-2-2#sibling-selector-variants
// add your desired variant 'peer-checked'
//
// Just like group can be combined with any other variant, peer can as well,
// so you have variants like peer-hover, peer-focus, peer-disabled, and loads more at your fingertips.
const plugin = require('tailwindcss/plugin');
const peer = plugin.withOptions(function (options) {
return function ({ addVariant, config }) {
const prefixSelector = function (prefix, selector) {
@mpalpha
mpalpha / tailwind.plugin.border.padding.js
Last active June 23, 2021 17:02
tailwind plugin to add border padding utilities.
// Inherits padding and border settings from your tailwind config to provide alternate padding utilities,
// which account for border sizes using the css calc() function.
//
// Usage: <div class="abds-pt-2-border-2" = "padding-top: calc(0.5rem - 2px);"
const _ = require('lodash');
const { borderWidth } = require('tailwindcss/defaultTheme');
module.exports = function () {
return function ({ addUtilities, e, config }) {
const paddings = config('theme.paddingBorder.padding', config('theme.padding', {}));