Skip to content

Instantly share code, notes, and snippets.

@joshuabenuck
joshuabenuck / reflash.sh
Created May 13, 2019 16:44
Script to reflash QMK firmware from the command line.
if [[ "$1" == "" ]]; then
echo "Usage: ./reflash.sh <firmware>"
exit
fi
echo "Press reset on your board..."
while true; do
ls /dev/cu.u* > /dev/null 2>&1
if [[ $? -eq 0 ]]; then
export DEV=$(ls /dev/cu.u*)
avrdude -patmega32u4 -cavr109 -b57600 -Uflash:w:$1 -P$DEV
@joshuabenuck
joshuabenuck / refresh.coffee
Created May 20, 2019 04:02
Class based item drag and drop refactor
class DragOp
start: (_, ui) =>
@origCursor = $('body').css('cursor')
$item = ui.item
$placeholder = ui.placeholder
# Create a copy that we control since sortable removes theirs too early.
# Insert after the placeholder to prevent adding history when item not moved.
# Clear out the styling they add. Updates to jquery ui can affect this.
$item.clone().insertAfter($placeholder).hide().addClass("shadow-copy")
@joshuabenuck
joshuabenuck / create_wiki
Created November 17, 2019 19:01
Quick script to create a self-contained fedwiki install. Data files are still stored in their default location (~/.wiki).
#!/bin/bash
rm -rf $1
mkdir $1
cd $1
curl -O https://nodejs.org/dist/v12.13.0/node-v12.13.0-linux-x64.tar.xz
tar Jxf *.tar.xz
rm *.tar.xz
mv node-* nodejs
git clone https://github.com/fedwiki/wiki
@joshuabenuck
joshuabenuck / main.rs
Last active December 7, 2019 18:33
Chirperjax Windows 10 Workaround
// chirperjax, a demo game built using the "gate" game library.
// Copyright (C) 2017-2019 Matthew D. Michelotti
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of