Skip to content

Instantly share code, notes, and snippets.

#import <Foundation/Foundation.h>
int main(int argc, const char * argv[])
{
@autoreleasepool {
int number = 0;
int round = 1;
NSMutableArray *array = [NSMutableArray array];
public func memoize<T: Hashable, U>(f: (T) -> U) -> (T) -> U {
var memo : [T : U] = [:]
return { x in
if let q = memo[x] {
return q
}
let r = f(x)
memo[x] = r
return r
}
var queryResult = self.database.executeQuery(select(star, person))
XCTAssertTrue(queryResult.isSuccess)
queryResult.consume { resultSet in
var name = result.name
...
}
override func viewDidAppear(animated: Bool) {
super.viewDidAppear(animated)
if self.alreadySearched {
return
}
self.alreadySearched = true
self.searchingAnimationView.showMessage2("LOOKING FOR HOTELS\nWITH VACANCIES") {
import Foundation
import ObjectMapper
class News : Mappable {
let id: Int
let username : String
let date: String
let share_url: String
let image: String
let title: String
@beelsebob
beelsebob / Window.swift
Last active September 19, 2015 20:05 — forked from freysie/Window.swift
class Window {
let element: AXUIElementRef
init?(processID: pid_t) {
element = AXUIElementCreateApplication(processID).takeRetainedValue()
}
var processID: pid_t {
let pid : pid_t
func migrate(noteManager : NoteManager) {
if let coreDataNotes = GNNote.MR_findAll() {
for case let note as GNNote in coreDataNotes {
if let bundleID = note.appBundleID, docPath = note.documentPath, content = note.content where !content.string.isEmpty {
noteManager.createNote(bundleID, docID: docPath, content: content)
}
}
}
}