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 / redux-routines.ts
Created December 30, 2017 19:24
redux routines with tuple actions and switch reducers
import { curry, __, mapObjIndexed, chain, pick, pipe } from 'ramda'
import { bindActionCreators, Dispatch, ActionCreatorsMapObject } from 'redux'
import { Creator, Switch } from './actions'
enum RoutineAction {
Trigger = 'TRIGGER',
Request = 'REQUEST',
Success = 'SUCCESS',
Failure = 'FAILURE',
}
@micimize
micimize / fluent.py
Last active May 10, 2020 23:23
arbitrary fluent interface
class FluentMeta(type):
def __getattr__(cls, ignore):
return cls()
def __getitem__(cls, ignore):
return cls()
class Fluent(metaclass=FluentMeta):
@micimize
micimize / userChrome.css
Last active September 9, 2023 18:13
firefox userChrome for slim sidebery sidebar tabs and inlining sidebar button in nav while active
/*
* Assuming OSX dark theme and compact nav using sidebery
* Should be readily customizable for whatever setup.
* To inspect browser elements, you'll want to:
* - Enable browser chrome and add-on debugging toolboxes in dev tools
* - Enable remote debugging
* - Go to Tools > Developer > Browser Toolbox (not Browser console)
* Editing browser elements through the debugger seems buggy at times,
* especially colors
*
@micimize
micimize / Map.ts
Last active November 29, 2019 16:43
[DON'T USE, JUST SCRATCH] Old Fantasy land / io-ts / immutable.js ideas
import * as I from 'immutable'
import { l, t, validater } from './t'
function IOMap<K extends t.Any, V extends t.Any>(keyType: K, valueType: V) {
type Key = t.TypeOf<K>
type Value = t.TypeOf<V>
type M = I.Map<Key, Value>
const Entries = t.array(t.tuple([ keyType, valueType ]))
@micimize
micimize / OwO.js
Created July 3, 2018 03:00
what's this?
C= XD =1
D= '8'
OwO =(
o=0,
O= XD
^('-')> XD
<(' - ')^ XD
^('-')^ XD
==` `== XD
@micimize
micimize / resolveBoxStyle.js
Created August 26, 2018 02:38
monkey patch for react-native inspector problems
/**
* Copyright (c) 2015-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @providesModule resolveBoxStyle
* @flow
*/
'use strict';
@micimize
micimize / react-native-issues.md
Last active March 24, 2019 20:26
My myriad problems experienced with react-native (I last worked with RN Sep 10th, 2018)

preface

This is a slightly cleaned-up version of the venting I did while pulling my hair out over react-native issues. The state of using react-native might be getting better with the community restructuring and core-rewrite. So take these dated notes with a grain of salt.

summary

After months of struggling to port libraries and develop applications using react-native, I have to recommend trading the comfort and breadth of the react and javascript ecosystems for Flutter and dart if you're developing a mobile app.

react-native is buggy and slow (or at least very hard to make fast). Perhaps it can be blamed on the size of the community, but the project is managed in an almost adversarial style. Almost all issues are ignored until the bot closes them for being "stale". They get locked too, just to make sure the community can't communicate work

@micimize
micimize / structured_cloud_log_handler.py
Last active February 27, 2019 21:53
Patches for the python stackdriver handlers for adding custom fields
import logging
import typing as t
from google.cloud.logging.handlers.handlers import (
DEFAULT_LOGGER_NAME,
CloudLoggingHandler,
)
from google.cloud.logging.handlers.transports import background_thread
@micimize
micimize / _client.dart
Last active March 26, 2019 18:02
transient state management prototypes for graphql-flutter
import 'package:graphql_flutter/graphql_flutter.dart';
import '../serializers/scalars.dart' show uuidFromObject;
/// This prefix works differently than the normalization prefix
/// in that it is prepended to the id as '$prefix/$id'
final TRANSIENT_STATE_PREFIX = '@entity/transient_state';
final cache = OptimisticCache(
dataIdFromObject: uuidFromObject,
);
@micimize
micimize / cheap_clone.sh
Created May 19, 2019 21:22
helper to clone a repo for inspection (relatively) cheaply
function cheap_clone {
EXTERNAL_CLONE_DIR="~/code/external"
# mkdir -p $EXTERNAL_CLONE_DIR
GIT_HOST='github.com'
BRANCH='master'
while [[ $# -gt 0 ]]
do
key="$1"
case $key in