Skip to content

Instantly share code, notes, and snippets.

View potmo's full-sized avatar

Nisse Bergman potmo

View GitHub Profile
@potmo
potmo / swift entity generation
Created September 30, 2016 20:30
generated-endpoint.swift
/* json to parse
{
"required_string": "test",
"optional_string": "test",
"required_int": 123,
"optional_int": 123,

Keybase proof

I hereby claim:

  • I am potmo on github.
  • I am potmo (https://keybase.io/potmo) on keybase.
  • I have a public key whose fingerprint is 6D02 BEF1 C699 4DDE AE4B 3C40 6763 5236 5258 71A5

To claim this, I am signing this object:

@potmo
potmo / injector.swift
Created February 25, 2016 21:23
Injection framework WIP for swift
import Cocoa
import Foundation
enum InjectionError: ErrorType {
case BindingNotFound(_:String)
}
protocol Initializable {
init()
@potmo
potmo / tutorial.md
Last active February 14, 2016 20:01
swift tutorial

Functions

func returnMyCoolStuff(name: String) -> String {
    return "freshness"
}

function arguments can also have default paremeter values

@potmo
potmo / nissepediachanges.txt
Created January 20, 2016 20:47
new and changed nissepedia articles
new: 2014-05-14T08:31:55Z Trimmad tändare
new: 2014-05-20T13:57:15Z Devalvering
new: 2014-05-20T13:58:41Z Inflation
new: 2014-05-28T09:13:45Z Manslyssna
new: 2014-05-30T14:29:47Z 6 juni
new: 2014-06-24T11:05:12Z Lokalkändis
new: 2014-06-25T11:21:19Z Furstespegel
new: 2014-07-02T11:58:40Z Metallica
new: 2014-07-04T14:49:48Z Dregen-matta
@potmo
potmo / instance.swift
Last active October 21, 2015 21:17
Instantiating objects from tupels
struct Test {
let a:String
let b:Int
init(a:String, b:Int){
self.a = a
self.b = b
}
}
@potmo
potmo / test.md
Last active November 7, 2016 11:08
Client test description

Create a single view app that requests data from a rest-api and display that data in the app for an american customer.

Get attributes for vehicle: GET /v1/vehicles/:vin/vehicle_attributes

Get the vehicle attributes for a given car

URI parameters

| Parameter | Description | Type | Required |

@potmo
potmo / overload-operator.Swift
Created January 25, 2015 16:34
Piping functions with operator overload
import UIKit
import Foundation
infix operator => { associativity right}
// Start with input
func => ( left: String, right: (String)->Void ) -> () -> Void {
func returnFunc () -> Void
{
right(left);