Skip to content

Instantly share code, notes, and snippets.

View blwinters's full-sized avatar

Ben Winters blwinters

  • Bambi
  • Cleveland, Ohio, United States
  • X @blwinters
View GitHub Profile
@blwinters
blwinters / DaysOfMonthGridCell.swift
Created December 18, 2017 14:18
A table view cell that displays a grid of days of the month by conforming to ButtonGridDisplayable.
//
// DaysOfMonthGridCell.swift
// Summit_iOS
//
// Created by Ben Winters on 9/25/17.
// Copyright © 2017 Goals LLC. All rights reserved.
//
import UIKit
@blwinters
blwinters / MonthGridCell.swift
Created December 18, 2017 14:17
A table view cell that displays a grid of months by conforming to ButtonGridDisplayable.
//
// MonthsOfYearGridCell.swift
// Summit_iOS
//
// Created by Ben Winters on 9/25/17.
// Copyright © 2017 Goals LLC. All rights reserved.
//
import UIKit
@blwinters
blwinters / ButtonGridDisplayable.swift
Created December 18, 2017 14:15
A protocol that creates a grid of multi-selectable buttons with contents specified by the delegate.
//
// ButtonGridDisplayable.swift
// Summit_iOS
//
// Created by Ben Winters on 9/26/17.
// Copyright © 2017 Goals LLC. All rights reserved.
//
import UIKit
@blwinters
blwinters / SMRecurrenceRuleTests.swift
Created December 17, 2017 21:37
Unit tests for generating dates from SMRecurrenceRule.
//
// SMRecurrenceRuleTests.swift
// Summit_iOS_Tests
//
// Created by Ben Winters on 9/6/17.
// Copyright © 2017 Goals LLC. All rights reserved.
//
import EventKit
import Foundation
@blwinters
blwinters / SMRecurrenceRule+DateGeneration.swift
Last active July 13, 2021 22:14
This code generates a series of dates based on complex recurrence rules as described in RFC 5445, section 3.8.5 (https://tools.ietf.org/html/rfc5545#section-3.8.5). This is used in Summit to allow users to create repeating tasks on the second Tuesday of January and July, for example.
//
// SMRecurrenceRule.swift
// Summit
//
// Created by Ben Winters on 8/27/17.
// Copyright © 2017 Goals LLC. All rights reserved.
//
import EventKit
import Foundation
@blwinters
blwinters / gist:b4861ba9968a68f50feeaaee1de3e5dd
Created February 28, 2017 00:03 — forked from jaredsinclair/set-build-number.sh
Simple, Git-friendly run script for automated build numbering in Xcode
#
# Set the build number to the current git commit count.
# If we're using the Dev scheme, then we'll suffix the build
# number with the current branch name, to make collisions
# far less likely across feature branches.
# Based on: http://w3facility.info/question/how-do-i-force-xcode-to-rebuild-the-info-plist-file-in-my-project-every-time-i-build-the-project/
#
# Updated with dSYM handling from http://yellowfeather.co.uk/blog/auto-incrementing-build-number-in-xcode-revisited/
#
@blwinters
blwinters / ioslocaleidentifiers.csv
Created February 5, 2017 17:35 — forked from jacobbubu/ioslocaleidentifiers.csv
iOS Locale Identifiers
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
mr Marathi
bs Bosnian
ee_TG Ewe (Togo)
ms Malay
kam_KE Kamba (Kenya)
mt Maltese
ha Hausa
es_HN Spanish (Honduras)
ml_IN Malayalam (India)
ro_MD Romanian (Moldova)