This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// MainControllerTests.swift | |
// Inhale | |
// | |
// Created by Michael Eisel on 1/7/15. | |
// Copyright (c) 2015 Fredrik Krafft. All rights reserved. | |
// | |
import XCTest |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public extension NSDate { | |
var calendarComponents: NSDateComponents { | |
get { | |
//let componentFlags: NSCalendarUnit = NSCalendarUnit(CalendarUnitEra) | |
let componentFlags = NSCalendarUnit(UInt.max) | |
return NSDate.currentCalendar().components(componentFlags, fromDate:self) | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#0 0x000000010e0e3755 in _os_lock_handoff_trylock () | |
#1 0x000000010d0a21e4 in objc_object::sidetable_release(bool) () | |
#2 0x00000001094930d5 in -[BFTask trySetResult:] at /Users/chrisp/src/build-sdk/Bolts-IOS/Bolts/Common/BFTask.m:171 | |
#3 0x0000000109492ff7 in -[BFTask setResult:] at /Users/chrisp/src/build-sdk/Bolts-IOS/Bolts/Common/BFTask.m:157 | |
#4 0x000000010948d12e in -[BFTaskCompletionSource setResult:] at /Users/chrisp/src/build-sdk/Bolts-IOS/Bolts/Common/BFTaskCompletionSource.m:48 | |
#5 0x0000000109493d6e in __41-[BFTask continueWithExecutor:withBlock:]_block_invoke_3 at /Users/chrisp/src/build-sdk/Bolts-IOS/Bolts/Common/BFTask.m:301 | |
#6 0x0000000109493b28 in __41-[BFTask continueWithExecutor:withBlock:]_block_invoke_2 at /Users/chrisp/src/build-sdk/Bolts-IOS/Bolts/Common/BFTask.m:287 | |
#7 0x00000001094948d7 in __29+[BFExecutor defaultExecutor]_block_invoke_2 at /Users/chrisp/src/build-sdk/Bolts-IOS/Bolts/Common/BFExecutor.m:43 | |
#8 0x0000000109494d39 in -[BFExecutor execute:] at /Users/chrisp/src/build-sdk/Bolt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#0 0x000000010d08db8a in objc_exception_throw () | |
#1 0x000000010d455e6d in +[NSException raise:format:] () | |
#2 0x00000001094c2284 in -[PFOfflineStore updateObjectIdForObject:oldObjectId:newObjectId:] at /Users/nlutsenko/src/parse/ios-client/Parse/Internal/PFOfflineStore.m:989 | |
#3 0x00000001094d22cf in -[PFObject setObjectId:] at /Users/nlutsenko/src/parse/ios-client/Parse/PFObject.m:1815 | |
#4 0x00000001095230fc in __28-[PFInstallation saveAsync:]_block_invoke at /Users/nlutsenko/src/parse/ios-client/Parse/PFInstallation.m:361 | |
#5 0x0000000109493b28 in __41-[BFTask continueWithExecutor:withBlock:]_block_invoke_2 at /Users/chrisp/src/build-sdk/Bolts-IOS/Bolts/Common/BFTask.m:287 | |
#6 0x000000010dd52ba6 in _dispatch_call_block_and_release () | |
#7 0x000000010dd707f4 in _dispatch_client_callout () | |
#8 0x000000010dd5b15d in _dispatch_root_queue_drain () | |
#9 0x000000010dd5c5d9 in _dispatch_worker_thread3 () |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Controller { | |
var defaultDate: NSDate { return NSDate() } | |
var currentDate: NSDate | |
func init() { | |
currentDate = defaultDate // causes error, because self doesn't exist yet | |
super.init() | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func pollutionFromStartDate(startDate: NSDate, toEndDate:NSDate) -> Double { | |
if (readings.count == 0) { | |
return 0 | |
} | |
let totalPollution = 0 | |
if (startDate < readings.first()!.date) { | |
totalPollution += readings.first()!.pollutionLevel * (readings.first()!.date - startDate) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'nokogiri' | |
require 'pry-byebug' | |
if ARGV.size < 1 | |
puts "please enter the file to use" | |
exit 1 | |
end | |
storyboard = Nokogiri::XML(IO.read(ARGV[0]), &:noblanks).root | |
views = storyboard.xpath("//subviews/*") + storyboard.xpath("//view") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'nokogiri' | |
if ARGV.size < 1 | |
puts "please enter the file to use" | |
exit 1 | |
end | |
storyboard = Nokogiri::XML(IO.read(ARGV[0]), &:noblanks).root | |
labels = storyboard.xpath("//label") | |
labels.each do |label| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func generatorInclude<T, Y: Sequence where T: Equatable, T == Y.GeneratorType.Element>(seq: Y, element: T) -> Bool { | |
for e in seq { | |
if e == element { | |
return true | |
} | |
} | |
return false | |
} | |
extension Array { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6458a13 HEAD@{0}: rebase -i (finish): returning to refs/heads/master | |
6458a13 HEAD@{1}: rebase -i (start): checkout HEAD~3 | |
d5a01b2 HEAD@{2}: rebase -i (finish): returning to refs/heads/master | |
d5a01b2 HEAD@{3}: rebase -i (start): checkout HEAD~2 | |
d5a01b2 HEAD@{4}: commit: created os x project, moved everything from before to ruby folder | |
102eb7e HEAD@{5}: commit: created os x program | |
6458a13 HEAD@{6}: commit: debugging image export | |
ea72280 HEAD@{7}: commit: starting with code generation | |
be49753 HEAD@{8}: commit: working on javascript stuff, very slow | |
a687e4b HEAD@{9}: commit: finished .dfont and .ttc, as well as everything but UIView, UITableViewCell, and UICollectionViewCell |