Skip to content

Instantly share code, notes, and snippets.

View micahscopes's full-sized avatar
🐢

Micah micahscopes

🐢
View GitHub Profile
@micahscopes
micahscopes / Omega Claude?.md
Last active March 20, 2024 23:10
OMEGA CLAUDE opens a portal...
@micahscopes
micahscopes / stream_buffer_until.rs
Created March 19, 2024 05:27
Buffer/release stream modifier
use futures::stream::Stream;
use futures::stream::{iter, Iter};
use log::info;
use std::{
collections::VecDeque,
fmt::Debug,
pin::{pin, Pin},
task::{Context, Poll},
};
@micahscopes
micahscopes / spring-follow.js
Created April 21, 2023 05:01
Spring follower
import requestAnimationFrame from 'raf';
export default class SpringFollow {
constructor(target, stiffness = 15, damping = 15) {
this.target = target;
this.stiffness = stiffness;
this.damping = damping;
this.velocity = this._initializeVelocity(target);
this.animationFrameId = null;
this.currentValues = this._clone(target);
@micahscopes
micahscopes / m.py
Created April 16, 2022 20:51
quaternion Moebius transformation in SymPy
from sympy import *
a,b,c,d,x = [Quaternion(*[IndexedBase(s)[i] for i in range(4)]) for s in ['a','b','c','d','x']]
(a*x + b)/(c*x + d)
@micahscopes
micahscopes / index.js
Created January 21, 2020 02:00
Rewind hypertrie
const ram = require("random-access-memory");
const hypertrie = require("hypertrie");
const db = hypertrie(ram);
let xItems = ["little", "bits", "of", "info"].map(
item => ({
type: "put",
key: "/x",
value: item
})
@micahscopes
micahscopes / krita-erratic-stylus-behavior.md
Last active October 6, 2019 17:09
Krita erratic stylus behavior

Summary

When using a stylus, Krita incorrectly and unpredictably switches between pen and eraser modes. Sometimes when I put the stylus pen tip down, it will switch to the eraser. Other times Krita is stuck in pen mode even when I use the eraser tip.

I've done some work to debug this problem and determined that Krita tablet tester log is inconsistent with xinput events.

I'm using a Wacom AES stylus called the Dell Active Pen (PN557W), which has a single tip and a button that switches the tip between PEN and RUBBER modes.

Steps to reproduce

  1. Do a stroke with the stylus pen tip
  2. Do a stroke with the stylus eraser tip (with the stylus switched to eraser mode if your stylus only has one tip like mine)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Keybase proof

I hereby claim:

  • I am micahscopes on github.
  • I am micahscopes (https://keybase.io/micahscopes) on keybase.
  • I have a public key ASBs4046sfnNaQQ-szMzsAqOguTYNnJ0pFeI_5EWWFprAQo

To claim this, I am signing this object:

@micahscopes
micahscopes / rot8.glsl
Last active April 14, 2023 01:59
8-dimensional planar rotations with Clifford Algebra and GLSL
// This function rotates the 8-dimensional vector v[8] by angle a in the plane swept through vectors fr[8] and to[8].
// It was generated using Sage's CliffordAlgebra module and Sympy's code printing tools.
// Mathematically, the function makes a rotor from the outer product of normalized 1-vectors fr ^ to, then uses that to do a
// sandwich product with v. You can read about this here: https://en.wikipedia.org/wiki/Rotor_(mathematics)
float[8] rotate(float v[8], float fr[8], float to[8], float angle) {
float sin_th = sin(angle*2*PI);
float cos_th = cos(angle*2*PI);
@micahscopes
micahscopes / gist:bf568c72e42bc9ddc2d754509dc8a98a
Created May 10, 2017 12:32 — forked from claus/gist:1396250
Resolution independent rendering of Bezier curves in WebGL
<!doctype html>
<html>
<head>
<title>Resolution independent rendering of Bezier curves in WebGL</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script src="glMatrix-0.9.6.min.js"></script>
<script id="shader-vs" type="x-shader/x-vertex">
attribute vec3 aVertexPosition;
attribute vec2 aBezierCoord;