Skip to content

Instantly share code, notes, and snippets.

View brianmichel's full-sized avatar
🎯
Focusing

Brian Michel brianmichel

🎯
Focusing
View GitHub Profile
@brianmichel
brianmichel / github-scroll.css
Created November 1, 2022 22:47
CSS Boost To Make GitHub's Left Column Scrollable
.dashboard-sidebar {
overflow: scroll !important;
}
@brianmichel
brianmichel / timerfires2
Created September 26, 2022 13:56
An updated version of the timerfires command that works on macOS 12+
#!/bin/sh
# timerfires
FORMAT='"%8d %5d %-16s %-16s "'
CURRENTTIME='(walltimestamp - starttime) / 1000000'
specifiers=0
opt_pid=0; pid=0
@brianmichel
brianmichel / sparkle-marconio-test.patch
Created February 4, 2022 22:01
A patch for a new test to exercise the Appcast parsing behavior in Sparkle for my failing updater.
diff --git a/Tests/SUAppcastTest.swift b/Tests/SUAppcastTest.swift
index a1e921db..336e959b 100644
--- a/Tests/SUAppcastTest.swift
+++ b/Tests/SUAppcastTest.swift
@@ -11,6 +11,27 @@ import Sparkle
class SUAppcastTest: XCTestCase {
+ func testBrokenAppcast() {
+ let testURL = Bundle(for: SUAppcastTest.self).url(forResource: "marconio-broken-appcast", withExtension: "xml")!
@brianmichel
brianmichel / NSExtensionContext+Loading.swift
Created June 5, 2021 12:25
Publisher-ify NSExtensionContext item loading
import Combine
import Foundation
extension NSExtensionContext {
enum Errors: Error {
/// An error passed when there is no error, and no item is returned.
case unableToLoadItem
}
/**
@brianmichel
brianmichel / Birbhouse-Code-of-Conduct.md
Last active May 19, 2020 21:29
Code of Conduct for Birbhouse Slack

This code pulls greatly from the XOXO Code of Conduct https://2018.xoxofest.com/conduct

COMMUNITY CODE OF CONDUCT

This policy is a "living" document, and subject to refinement and expansion in the future. Last updated May 19th, 2020.

Everyone participating in the Birbhouse community—including, but not limited to the Slack group—is required to agree to the following Code of Conduct. This includes all members, no exceptions.

Birbhouse is dedicated to providing a harassment-free experience for everyone, regardless of gender, gender identity and expression, sexual orientation, disability, mental illness, neurotype, physical appearance, body, age, race, ethnicity, nationality, language, or religion. We do not tolerate harassment of participants in any form.

Anyone who violates this Code of Conduct may be sanctioned or expelled from the Birbhouse Slack group at the discretion of the Birbhouse admins.

extension String {
subscript (bounds: CountableClosedRange<Int>) -> String {
let start = index(startIndex, offsetBy: bounds.lowerBound)
let end = index(startIndex, offsetBy: bounds.upperBound)
return String(self[start...end])
}
subscript (bounds: CountableRange<Int>) -> String {
let start = index(startIndex, offsetBy: bounds.lowerBound)
let end = index(startIndex, offsetBy: bounds.upperBound)

Keybase proof

I hereby claim:

  • I am brianmichel on github.
  • I am brianmichel (https://keybase.io/brianmichel) on keybase.
  • I have a public key whose fingerprint is 8398 AA13 7CA6 C265 E9FA 7072 B0E0 1B54 3A70 96C5

To claim this, I am signing this object:

@brianmichel
brianmichel / swift-lint-buildphase.sh
Created May 23, 2017 14:46
SwiftLint Build Phase
git diff HEAD --name-only -- "Ando/*.swift" | while read filename; do
${PODS_ROOT}/SwiftLint/swiftlint lint --path "$filename";
done
@brianmichel
brianmichel / pennant.rb
Last active September 6, 2017 21:30
Scrape Clubhouse.io tickets from git logs.
#!/usr/bin/env ruby
require 'optparse'
options = {
repo: File.expand_path(`pwd`),
verbose: false
}
parser = OptionParser.new do |opts|
opts.banner = 'Usage: pennant.rb -p TAG_PATTERN'
@brianmichel
brianmichel / FailingCast.swift
Created December 15, 2016 20:53
Returned value is a string, but cannot be cast to as String
import Foundation
protocol KeyValueStorage {
func set(_ value: Any?, forKey key: String)
func value(forKey key: String) -> Any?
}
final class DictionaryKeyValueWrapper: KeyValueStorage {
var dictionary = [String: Any?]()