Skip to content

Instantly share code, notes, and snippets.

View tewha's full-sized avatar

Steven Fisher tewha

  • 13:31 (UTC -07:00)
View GitHub Profile

Revered Elder

You are widely respected for your age, wisdom, and care. Whether as a healer, teacher, or spiritual guide, you served your community for so long and so well that your reputation has begun to travel beyond it. Many pilgrims, travelers, or former students have passed through your home and shared stories of you with others. Now, as you walk the wider world, you sometimes find familiar eyes or unexpected kindness from strangers who know your name—or whose lives you once touched indirectly.


Skill Proficiencies:

Insight, Medicine

Tool Proficiencies:

@tewha
tewha / clear.sh
Created May 29, 2025 22:37
Clear Dock
#!/bin/sh
defaults write "com.apple.dock" "persistent-apps" -array; killall Dock
@tewha
tewha / threecolumn.kt
Created March 26, 2022 23:46
Three column row
package com.example.myapplication
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.layout.*
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Surface
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
@tewha
tewha / new-mac.md
Last active March 27, 2022 23:25
New Mac steps

This is my personal setup list. Yours may vary.

  1. Check networking.
    • May not match network you actually joined, since Apple syncs WiFi networks over iCloud account.
    • If you want to Ethernet via a Thunderbolt Display, attach the cable and restart to make the interface appear. The ones you can add are all false friends.
  2. Change Mission Control screen keyboard shortcuts for changing screens.
    • They interfere with subword navigation in Xcode.
    • These need to be changed in Keyboard Shortcuts, not Mission Control.
      • Mission Control offers fewer options.
  3. Disable caps lock.

Keybase proof

I hereby claim:

  • I am tewha on github.
  • I am tewha (https://keybase.io/tewha) on keybase.
  • I have a public key ASAykxBa8QqrX2hg6nao3GlKI8lNUhQ4uvwPbiBrSIgNdQo

To claim this, I am signing this object:

@tewha
tewha / DictionaryOfEnumBindingsWorker.m
Last active December 25, 2015 08:09
Inspired by NSDictionaryOfVariableBindings.
#define DictionaryOfEnumBindings(...) DictionaryOfEnumBindingsWorker(@"" # __VA_ARGS__, __VA_ARGS__, nil)
NSDictionary *DictionaryOfEnumBindingsWorker(NSString *commaSeparatedKeysString, int firstValue, ...) {
NSMutableDictionary *enums = [NSMutableDictionary dictionary];
NSMutableArray *names = [[commaSeparatedKeysString componentsSeparatedByString:@","] mutableCopy];
va_list ap;
va_start(ap, firstValue);
NSCharacterSet *whiteSpace = [NSCharacterSet whitespaceAndNewlineCharacterSet];
NSString *firstPaddedName = [names objectAtIndex:0];
@tewha
tewha / DateTest.m
Last active December 24, 2015 02:39
//
// DateTest.m
// DateTest
//
// Created by Steven Fisher on 2013-09-27.
//
#import "DateTest.h"
void RunDateTest() {
@tewha
tewha / gist:5265978
Last active December 15, 2015 13:18
This is a category on UIImage.
- (UIImage *)rxScalePropertionallyToMaximumSize:(CGSize)maxSize blendMode:(CGBlendMode)blendMode alpha:(CGFloat)alpha scale:(CGFloat)scale {
if ((maxSize.width < 1.0e-15) || (maxSize.height < 1.0e-15)) return nil;
CGSize imageSize = self.size;
CGSize scaleFactors = {
.width = maxSize.width / imageSize.width,
.height = maxSize.height / imageSize.height,
};
@tewha
tewha / keyboardWillShowNotification.m
Created September 21, 2012 00:17
keyboardWillShowNotification
- (void)keyboardWillShowNotification:(NSNotification *)notification {
dispatch_async(dispatch_get_main_queue(), ^{
UIView *workingView = self.view;
CGRect keyboardScreenRect = [[[notification userInfo] objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue];
CGRect keyboardRect = [workingView convertRect:keyboardScreenRect fromView:nil];
CGRect resizeRect = [workingView convertRect:_resizingView.superview.bounds fromView:_resizingView.superview];
CGRect unionRect = CGRectIntersection(keyboardRect, resizeRect);
CGFloat bottom = resizeRect.origin.y + resizeRect.size.height;
if (!isinf(unionRect.origin.y)) {
- (void)colors {
// Working with colors in Cocoa Touch.
// I think almost everyone uses RGB decimal, which is the worst of the ways. You don't have easy control of
// brightness, and you've got decimal points in your code that don't map to the way you think of RGB.
UIColor *rgbDec = [UIColor colorWithRed:0.484 green:0.745 blue:0.191 alpha:1.000];
// If you're working from 0-255, why not just code that?
UIColor *rgbFrac = [UIColor colorWithRed:123.0/255.0 green:190.0/255.0 blue:49.0/255.0 alpha:1.000];