Skip to content

Instantly share code, notes, and snippets.

@pfn
pfn / butterflight_config.txt
Created May 16, 2022
butterflight + omnibus + x4r
View butterflight_config.txt
2022-05-15 @21:52:41 -- OS: Windows
2022-05-15 @21:52:41 -- Configurator: 10.8.0 (be4a9e1)
2022-05-15 @21:52:42 -- Loaded release information for configurator from GitHub.
2022-05-15 @21:52:48 -- Serial port successfully opened with ID: 1
2022-05-15 @21:52:48 -- MultiWii API version: 1.40.0
@pfn
pfn / output.c
Created Dec 7, 2021
updating qmk json2c to maintain key layout formatting if possible
View output.c
// $ qmk json2c no_mod_tap_a.json
#include QMK_KEYBOARD_H
/* THIS FILE WAS GENERATED!
*
* This file was generated by qmk json2c. You may or may not want to
* edit it directly.
*/
@pfn
pfn / grr.py
Last active May 7, 2022
Simple tool to mirror (download) RRF configuration to local host
View grr.py
#!/usr/bin/env python
# tested on python3
import argparse
import ctypes
import hashlib
import http
import json
import os
@pfn
pfn / lis3dh_esp8266.cpp
Last active Oct 13, 2021
LIS3DH data collection for RRF using a Wemos D1 Mini
View lis3dh_esp8266.cpp
#include <Arduino.h>
#include <SPI.h>
#include <ESP8266WiFi.h>
#include <WifiClient.h>
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>
#define STASSID "YOURSSIDHERE"
#define STAPSK "YOURWIFIPSKHERE"
View arduino pot to pwm.c
void setup() {
Serial.begin(9600);
pinMode(11, OUTPUT);
analogReference(DEFAULT);
}
void loop() {
static int lastValue = 0;
int value = analogRead(A0) >> 3;
if (lastValue != value) {
@pfn
pfn / javap.txt
Created Apr 3, 2018
databinding 2.3.0 has broken classes
View javap.txt
com.android.databinding $ javap -classpath ./compilerCommon/jars/compilerCommon-2.3.0.jar 'android/databinding/parser/BindingExpressionParser$IdentifierContext'
Compiled from "BindingExpressionParser.java"
public class android.databinding.parser.BindingExpressionParser$IdentifierContext extends org.antlr.v4.runtime.ParserRuleContext {
public org.antlr.v4.runtime.tree.TerminalNode Identifier();
public android.databinding.parser.BindingExpressionParser$IdentifierContext(org.antlr.v4.runtime.ParserRuleContext, int);
public int getRuleIndex();
public void enterRule(org.antlr.v4.runtime.tree.ParseTreeListener);
public void exitRule(org.antlr.v4.runtime.tree.ParseTreeListener);
public <T> T accept(org.antlr.v4.runtime.tree.ParseTreeVisitor<? extends T>);
}
@pfn
pfn / c.vimrc
Last active Dec 31, 2017
cVimrc
View c.vimrc
imap <C-p> backwardLine
imap <C-n> forwardLine
imap <C-k> deleteToEnd
site '*://discordapp.com/*' {
unmap <C-k>
iunmap <C-k>
}
@pfn
pfn / splitframes.js
Created Apr 21, 2017
usage is now splitFrames(framedata, casttime, dwdelay, firsthit, numoffsets, showindividualwields, enabledualwieldcast, showdrops)
View splitframes.js
function splitFrames(frames, cast, dwdelay, fst, offsets, showwields, enabledw, enabledrops) {
var out = [];
var firsthits = [];
for (var i = 0; i <= offsets; i++) {
var newhits = splitFramesOffset(frames, cast, dwdelay, fst, i, firsthits, showwields, enabledw, enabledrops);
if (firsthits.length == 0)
firsthits = newhits[0];
out = out.concat(newhits);
}
return out;
@pfn
pfn / gist:34c1a34f6008c02c50f519ac7622b5e3
Created Jan 19, 2017
google play-services screwed up .sha1 checksums, broken since October
View gist:34c1a34f6008c02c50f519ac7622b5e3
$ find . -name '*.sha1' | xargs -n 1 xxd
00000000: da39 a3ee 5e6b 4b0d 3255 bfef 9560 1890 .9..^kK.2U...`..
00000010: afd8 0709 ....
00000000: da39 a3ee 5e6b 4b0d 3255 bfef 9560 1890 .9..^kK.2U...`..
00000010: afd8 0709 ....
00000000: da39 a3ee 5e6b 4b0d 3255 bfef 9560 1890 .9..^kK.2U...`..
00000010: afd8 0709 ....
00000000: da39 a3ee 5e6b 4b0d 3255 bfef 9560 1890 .9..^kK.2U...`..
00000010: afd8 0709 ....
00000000: 3366 3831 6265 3437 3531 6337 3366 6234 3f81be4751c73fb4
@pfn
pfn / main.rs
Last active Jun 19, 2020
rust experiment, porting hide-app.c
View main.rs
extern crate winapi;
extern crate user32;
extern crate gdi32;
extern crate comctl32;
extern crate kernel32;
use std::ptr::null_mut;
use std::mem::size_of;
use std::mem::zeroed;
use std::os::raw::c_int;