Skip to content

Instantly share code, notes, and snippets.

Matthew Crenshaw sgtsquiggs

Block or report user

Report or block sgtsquiggs

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Logging.swift
import CocoaLumberjack
extension DDLogFlag {
public var level: String {
switch self {
case DDLogFlag.error: return "❤️ ERROR"
case DDLogFlag.warning: return "💛 WARNING"
case return "💙 INFO"
case DDLogFlag.debug: return "💚 DEBUG"
case DDLogFlag.verbose: return "💜 VERBOSE"
View crossthestreams.swift
import RxSwift
extension PrimitiveSequence where TraitType == SingleTrait {
public func asMaybe() -> PrimitiveSequence<MaybeTrait, Element> {
return self.asObservable().asMaybe()
public func asCompletable() -> PrimitiveSequence<CompletableTrait, Never> {
return self.asObservable().flatMap { _ in Observable<Never>.empty() }.asCompletable()
sgtsquiggs / Observable+BindCollection.swift
Last active Jul 12, 2018
Bind an observable to a collection of observers at once.
View Observable+BindCollection.swift
import RxSwift
extension ObservableType {
func bind<O>(to observers: [O]) -> Disposable where O: ObserverType, Self.E == O.E {
let shared = self.share()
let disposables =
return CompositeDisposable(disposables: disposables)
sgtsquiggs / random_investigator
Last active Mar 19, 2019
Arkham Horror Investigator Randomizer
View random_investigator
#!/usr/bin/env python
import sys
import getopt
import random
def main(argv):
investigator_type = 'all'
full_team = False
pick_two = False
sgtsquiggs / UIImage+PDFDocument.swift
Created Nov 2, 2017
UIImage extension for PDF documents
View UIImage+PDFDocument.swift
import UIKit
extension UIImage {
convenience init?(pdfDocument: CGPDFDocument, pageNumber: Int = 1) {
guard let page = pageNumber) else { return nil }
let size = page.getBoxRect(.mediaBox).size
UIGraphicsBeginImageContextWithOptions(size, true, UIScreen.main.scale)
let context = UIGraphicsGetCurrentContext()!
sgtsquiggs / download_devices.rb
Created Dec 13, 2016
Fastlane action to download device UDIDs for the current team
View download_devices.rb
module Fastlane
module Actions
class DownloadDevicesAction < Action
require 'spaceship'
ship = Spaceship::Portal.login(ENV['DELIVER_USER'], ENV['DELIVER_PASSWORD'])
ship.team_id = CredentialsManager::AppfileConfig.try_fetch_value(:team_id)
devices = ship.devices
sgtsquiggs / new_relic_system_monitor.ebextensions.config
Last active Jul 29, 2016
New Relic Server Monitoring on Elastic Beanstalk
View new_relic_system_monitor.ebextensions.config
# installs and configures New Relic System Monitoring agent
# requires `AmazonEC2ReadOnlyAccess` policy to get eb environment name
mode: "000755"
owner: root
group: root
content: |
import random
def draw_board(board):
print(' | |')
print(' %s | %s | %s' % (board[1], board[2], board[3]))
print(' | |')
print(' | |')
print(' %s | %s | %s' % (board[4], board[5], board[6]))
View showmethefonts.m
for (NSString *familyName in [UIFont familyNames]){
NSLog(@"Family name: %@", familyName);
for (NSString *fontName in [UIFont fontNamesForFamilyName:familyName]) {
NSLog(@"--Font name: %@", fontName);
sgtsquiggs /
Created Feb 24, 2015 Verification

Keybase proof

I hereby claim:

  • I am sgtsquiggs on github.
  • I am sgtsquiggs ( on keybase.
  • I have a public key whose fingerprint is C5E6 CDA3 BB97 829F AAA1 6E68 4712 D21A 0B0E A994

To claim this, I am signing this object:

You can’t perform that action at this time.