Skip to content

Instantly share code, notes, and snippets.

View micimize's full-sized avatar

Michael Joseph Rosenthal micimize

  • San Francisco, CA
View GitHub Profile
@micimize
micimize / ghistory_sketch.md
Last active February 20, 2024 23:24
Idea for a standalone, automatic git-based workspace history tracker/navigator

Given the interest here I wanted to mention an idea I had for implementing this as a standalone utility:

  1. Init a bare repo in projectroot/.ghistory + a background job that auto-commits to it with high frequency (< 1s) without touching the primary working tree
  2. Derive tree of file edits/states from ghistory repo for navigation/checkout, maybe as a git tree
  3. Periodically compress/clean the ghistory tree to most 5min intervals

I know it's a fundamentally different approach & requires saving, but it'd have the benefits of being editor agnostic and eternal, as well as automating away the need for anxious WIP commits.

IDK if I'll ever implement this myself so I wanted to put the idea out into the aether.

Edit: In retrospect a git notes namespace would probably make more sense (https://alblue.bandlem.com/2011/11/git-tip-of-week-git-notes.html)

Attached in the comment are recordings taken with the right, both, then left headphones (You have to unmute to listen on github).

As you can hear, in all recordings, the quality is fairly low. But even worse, sometimes my voice becomes unintelligible.

I conducted this test after recipients of the first two calls I had with the Jabra Elite Pro 7 said I was muffled. This was never a noticible issue on the 65t. Only confounding variable there is that I never used the "ear filling" eartip on the 65t.

@micimize
micimize / failed_filter_mypy_none_returns.py
Last active September 9, 2022 20:23
It doesn't work because the note is only emitted in very simple cases
from sys import stdin
from sys import stdout
from typing import Final
from typing import Iterable
MISSING_RETURN_TYPE: Final = "error: Function is missing a return type annotation [no-untyped-def]\n"
USE_NONE: Final = 'note: Use "-> None" if function does not return a value\n'
def filter_non_returns(mypy_lines: Iterable[str]) -> Iterable[str]:
@micimize
micimize / main.py
Created September 9, 2022 15:44 — forked from mypy-play/main.py
Demonstration of mutability and covariance inference
from typing import List, Sequence, Dict, Mapping
from typing_extensions import reveal_type
class Animal:
pass
class Dog(Animal):
pass
@micimize
micimize / _raw_flutter_time_picker_hack.dart
Last active December 2, 2022 04:35
Hack pulled out of flutter to customize the time picker dialog
// Copy-pasted from flutter/lib/src/material/time_picker.dart
// and hacked apart into a kind-of-useable composable solution
// until the core team has time and inclination to rework the API.
//
// NOTE: No docs adjusted and I likely broke restoration somehow.
//
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

Generally, to make it easier to diagnose the issues:

  1. Debug each part of your code yourself, eliminating potential bug sources beyond the bounds of this library. I.e, verify your back end fetching and parsing code results in valid data, then use that in your issue.
  2. Simplify the code as much as possible, removing styling, unrelated logic etc (this may help you identify the issue as well).
  3. Add full errors and stack traces.
  4. Use <details> tags liberally so the main issues are front loaded, but context isn't lost.
  • foo bar
  • hmmm
@micimize
micimize / window_stacks.lua
Created July 7, 2021 02:49
hammerspoon script for stacking and rotating through windows
hs.window.animationDuration = 0 -- disable animations
local menuHeight = 40
local W = hs.window
local WF = hs.window.filter
local G = hs.geometry
function getWindowsBehind(region)
local wf = WF.copy(WF.defaultCurrentSpace):setRegions({region})
import 'dart:math';
void main() {
final bigNumber = 100000000;
final w = new Stopwatch()..start();
for (int i = 0; i < bigNumber; i++) {
try {
sin(1);
} catch (ex) {
@micimize
micimize / redirect.md
Last active August 27, 2021 15:06
[OUTDATED] use SocketClientConfig.connect instead. old work around to headers for graphql flutter