Skip to content

Instantly share code, notes, and snippets.

View paulz's full-sized avatar
🍐
pairing is caring

Paul Zabelin paulz

🍐
pairing is caring
View GitHub Profile
@paulz
paulz / TimeIntervalParsing.swift
Last active May 15, 2021 21:29 — forked from Odie/gist:e26bc299bfc1f020e636
Parse user friendly time duration string in Swift
extension DateComponents {
subscript(unit: String) -> Int {
get {
switch unit {
case "month":
return self.month!
case "day":
return self.day!
case "hour":
return self.hour!
@paulz
paulz / remove-boilerplate-comments-from-xcode-templates.sh
Created December 13, 2015 08:06
Remove Useless Header comments from Xcode Templates
#!/bin/bash
# Usage:
# $ cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Templates
# $ bash ~/remove-boilerplate-comments-from-xcode-templates.sh
# Repeat for /Applications/Xcode.app/Contents/Developer/Library/Xcode/Templates
find -E . -type f \
\( -regex '.*\.[chm]' -or -regex '.*\.swift' \) \
-exec sed -i '' '1,/^$/d' '{}' ';'