Skip to content

Instantly share code, notes, and snippets.

// swiftlint:disable file_length
fileprivate func compareOptionals<T>(lhs: T?, rhs: T?, compare: (_ lhs: T, _ rhs: T) -> Bool) -> Bool {
switch (lhs, rhs) {
case let (lValue?, rValue?):
return compare(lValue, rValue)
case (nil, nil):
return true
default:
return false
}
@dwfreed
dwfreed / agency.txt
Last active April 24, 2017 13:05
Caltrain GTFS (up to date as of 2017-04-10)
agency_id,agency_name,agency_url,agency_timezone,agency_lang,agency_phone
CT,Caltrain,http://www.caltrain.com,America/Los_Angeles,en,800-660-4287
@staltz
staltz / introrx.md
Last active April 25, 2024 04:18
The introduction to Reactive Programming you've been missing
@paulirish
paulirish / 0readme.md
Created August 22, 2011 05:26
For converting adium logs to decently sexy HTML

adium log export to HTML

this shit is for exporting this weirdass xml out into some sane HTML.

  • run rename.sh to kill the whitespaces in your xml filenames
    • alternatively fix my htmlify.sh to not break on whitespace'd filenames
      • UPDATE: check this comment on a quick fix to avoid this rename script. BOOM! thx @kwef!
  • run htmlify.sh
    • htmlify has a hardcoded destination directory.
  • htmlify also expects the format-html.* files to be up one folder from it.