This file contains 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 getType<T>(type: T.Type) -> T.Type { | |
return type.self | |
} | |
class Foo { | |
required init() { } | |
} | |
let MyType = getType(Foo) | |
let myFoo = MyType.init() |
This file contains 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
// add this method to ZXAztecDecoder.m (ZXingObjC) | |
+ (NSString *)UIC9183TicketId:(ZXBoolArray *)correctedBits | |
{ | |
NSMutableData *bytes = [[NSMutableData alloc] init]; | |
int endIndex = (int)correctedBits.length; | |
ZXAztecTable latchTable = ZXAztecTableUpper; // table most recently latched to | |
ZXAztecTable shiftTable = ZXAztecTableUpper; // table to use for the next read | |
This file contains 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
override func viewWillAppear(animated: Bool) { | |
super.viewWillAppear(animated) | |
registerKeyboardNotifications() | |
} | |
override func viewWillDisappear(animated: Bool) { | |
super.viewWillDisappear(animated) | |
unregisterKeyboardNotifications() | |
} | |
This file contains 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
- (void)viewDidLoad | |
{ | |
NSLog(@"view did load"); | |
[super viewDidLoad]; | |
// Do any additional setup after loading the view, typically from a nib. | |
//NSLog(@"View Controller Container. Width: %f, Height: %f", self.container.frame.size.width, self.container.frame.size.height); | |
} |
This file contains 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
template: something, | |
events: { | |
"click #foto-modal-produkt-lagre": "saveProdukt", | |
"click #foto-modal-produkt-avbryt": "close", | |
"click #foto-modal-produkt-slett": "deleteProdukt", | |
"keyup #produkt-edit-modal-template:input" : "inputPressed" | |
}, | |
inputPressed: function(e) { | |
console.log("pressed") // never happens :( |
This file contains 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 function __get($name, $value) { | |
if ($name == "tariff" && get_called_class() != get_class($this)) { | |
return (intval($this->$name) / 100); | |
} else if ($name == "durationType" && get_called_class() != get_class($this)) { | |
} else { | |
return $this->$name; | |
} | |
} |