A Developing Blog

Dec 2015

Cheltenham Traffic Data

Cheltenham traffic data
Comments

Swift


Playing around with custom operators… which seems to confuse the html formatter…






import UIKit

infix operator |> { associativity left precedence 180 }

func |> (lhs: Int, rhs: Int) -> Int {

return lhs+rhs
}

class TestThis {

func doTest() {
print("This is a test")
print(3 |> 12 |> 10)
}

}







Code to figure out how many weeks in a month…


func weeksInMonth(month: Int, year: Int) -> (Int)? {

let calendar = NSCalendar.currentCalendar()

let comps = NSDateComponents()
comps.
month = month+1
comps.
year = year
comps.
day = 0

guard let last = calendar.dateFromComponents(comps)
else {
return nil
}

let tag = calendar.components([.WeekOfMonth,.WeekOfYear,
.YearForWeekOfYear,.Weekday,.Quarter], fromDate: last)

return tag.weekOfMonth

}

if let numWeeks = weeksInMonth(5,year: 2015) {
print(numWeeks)
}





Good swift reference
http://appventure.me/2015/10/24/swift-reflection-api-what-you-can-do/

NSCoding and Swift Structs
http://swiftandpainless.com/nscoding-and-swift-structs/




Good tutorial on creating a 3 node cluster

https://cloud.google.com/container-engine/docs/tutorials/hello-node#step_3_create_your_cluster

And, here's the more advanced one…

https://cloud.google.com/container-engine/docs/tutorials/guestbook



Comments

Getting Messages from iMessages

You can read the messages from here…

~/Library/Messages]$ sqlite3 chat.db

Comments

GCM

Good reference:

https://github.com/googlesamples/gcm-playground

Comments

Notification Handlers


I gotta remember this…

NSNotificationCenter.defaultCenter().addObserver(self, selector: "handleOpenURL:", name:"HANDLEOPENURL", object: nil)
// let delegate = UIApplication.sharedApplication().delegate as? AppDelegate
Comments

iOS Notes


 
XCPShowView(_:view:) is deprecated. Set 'XCPlaygroundPage.liveView' instead.


XCPShowView("Container View", view: containerView)
becomes:
XCPlaygroundPage.currentPage.liveView = containerView´╗┐
Comments

Google App Engine

Reference for cron jobs:
https://cloud.google.com/appengine/docs/python/config/cron?hl=en#Python_app_yaml_About_cron_yaml

Comments

Active EMS Incidences

http://www.montcopa.org/index.aspx?NID=834
Comments

Cool Site Hackathons


http://devpost.com/hackathons

Comments