Skip to content

Instantly share code, notes, and snippets.

View tylerarnold's full-sized avatar

Tyler tylerarnold

View GitHub Profile
//
// ContentView.swift
// Widgets
//
// Created by Kyle Halevi on 7/3/20.
//
import SwiftUI
struct Widget: View {
@shaps80
shaps80 / UIView+KeyView..swift
Created December 13, 2019 17:49
A UIView helper extension that finds the 'key' view in the controller's hierarchy. Useful for finding a UITableView/UICollectionView or any other view that's NOT the controller's root view.
import UIKit
internal extension UIViewController {
/// Returns the 'key' view for this controller. I.e. the top-most visible view that covers the view's entire bounds.
/// This is generally the controller's root view, but it could also be a nested table/collection view, etc...
@objc var _keyView: UIView {
return view._keyViews(in: self).last ?? view
}
import Dispatch
/*
Note: Thanks, Ian Keen and Zev Eisenberg and Sven Weidauer
Zev Eisenberg: "Do you still have to specify 1 << _n_ manually for `OptionSet` conformance? There’s no magic?"
This solution creates values that don't matter. They're simply unique, since option sets should not be accessed by raw value outside the implementation. (Versus direct `UInt`, which supports bit manipulation operations)
*/
import UIKit
import XCPlayground
class ViewController: UIViewController {
func action() { print("Bing!") }
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .whiteColor()
@skalnik
skalnik / instructions.md
Last active June 27, 2021 04:44
Shimano Ultegra Crankset in Chris King PF30 Bottom Bracket

Installing a Shimano Ultegra Crankset (24mm spindle) in a Chris King PF30 Bottom bracket

Initial BB

Remove black plastic inner sleeves from Bottom bracket

BB w/o plastic sleeves

Lightly grease interface of adapter and press in by hand. Repeat on both sides.

@iamatypeofwalrus
iamatypeofwalrus / generate_ctags.md
Last active February 11, 2019 10:17
Generate ctags for Atom (or for any other reason) on Mac os X

Why?

Atom can automagically picks up any tags file in your current directory which enables you to:

  • shift+cmd+r search for any function in your project
  • alt+cmd+down GoTo a function declaration

How

Get brew if you don't already have it. Then:

brew install ctags

@lisamelton
lisamelton / detect-crop.sh
Last active November 28, 2018 02:39
Detect crop values for video file to use with `mplayer` and `transcode-video.sh` (a wrapper script for `HandBrakeCLI`).
#!/bin/bash
#
# detect-crop.sh
#
# Copyright (c) 2013-2015 Don Melton
#
about() {
cat <<EOF
$program 3.3 of January 22, 2015
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';