Skip to content

Instantly share code, notes, and snippets.

View Reflejo's full-sized avatar

Martín Conte Mac Donell Reflejo

View GitHub Profile
@Reflejo
Reflejo / gist:f5addfa6408d521a971f
Created January 26, 2015 19:07
Bezier path creation
func bezierPath(p1: CLLocationCoordinate2D, toPoint p2: CLLocationCoordinate2D, steps: Int = 100)
-> [CLLocationCoordinate2D]
{
let auxiliaryPoint = self.fetchThirdPointByLocations(p1, p2: p2, angle: 90.0)
var targetPoints = [CLLocationCoordinate2D]()
let doubleSteps = Double(steps)
for index in 0 ... steps {
let t = Double(index) / doubleSteps
struct Foo {
var bar: String = ""
}
class Something {
var foo: Foo = Foo() {
didSet {
println("didSet called")
}
}
@Reflejo
Reflejo / Options.swift
Last active August 29, 2015 14:13
Simplified version
#!/usr/bin/env xcrun swift -O
struct MyOptions: RawOptionSetType, BooleanType {
var boolValue: Bool { return self.rawValue != 0 }
var rawValue: UInt
init(rawValue value: UInt) {
self.rawValue = value
}
init(nilLiteral: Void) {
#!/usr/bin/env osascript
on run argv
if count of argv < 1 then
logEvent("Usage: ./changeVersion iOSVersion(7.1,7.0)")
error number -128
end
set iOSVersion to item 1 of argv