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 / 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?]()
#!/usr/bin/env ruby
require 'pathname'
exit 1 unless ARGV[0]
full_file_path = File.expand_path("#{ARGV[0]}")
puts "got file path: #{full_file_path}"
exit 1 unless File.extname(full_file_path) == '.xcactivitylog'
on onConfirmUninstall()
set applicationName to "Slack"
try
display dialog "Are you sure you want to reset " & applicationName & "?"
set uninstallScript to quoted form of POSIX path of (path to resource "uninstall.bash")
do shell script "bash " & uninstallScript with administrator privileges
display dialog "Successfully Reset " & applicationName buttons {"OK"} default button "OK"
on error err
if err contains "User canceled" then
#import <Foundation/Foundation.h>
/**
* A stand-in for `NSURLQueryItem` that can be used on iOS 7.
*/
@interface TMURLQueryItem : NSObject
/**
* @see `NSURLQueryItem`
*/
* thread #1: tid = 0xcd78fb, 0x000000010451eb7b CoreGraphics`CG::Path::Sequence::operator==(CG::Path::Shape const&) const + 17, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
* frame #0: 0x000000010451eb7b CoreGraphics`CG::Path::Sequence::operator==(CG::Path::Shape const&) const + 17
frame #1: 0x0000000104482ea6 CoreGraphics`path_equal(void const*, void const*) + 36
frame #2: 0x0000000108498774 CoreFoundation`CFEqual + 388
frame #3: 0x00000001058c9a07 QuartzCore`CAValueEqual + 83
frame #4: 0x00000001059d54da QuartzCore`CA::Layer::setter(unsigned int, _CAValueType, void const*) + 140
frame #5: 0x00000001059cef1a QuartzCore`CALayer_setter_kCAValueRetainedPointer + 38
frame #6: 0x00000001059f14e2 QuartzCore`-[CAShapeLayer setPath:] + 37
frame #7: 0x00000001059baeca QuartzCore`-[CABasicAnimation applyForTime:presentationObject:modelObject:] + 959
frame #8: 0x00000001059be60b QuartzCore`-[CAAnimationGroup applyForTime:presentationObject:modelOb