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
struct Pointer<T: Any>: CustomStringConvertible { | |
let address: UInt | |
let description: String | |
let debugDescription: String | |
init(to valueTypePtr: UnsafePointer<T>) { | |
address = UInt(bitPattern: valueTypePtr) | |
let pointee = valueTypePtr.pointee | |
description = "<\(type(of: pointee)): 0x\(address.hexString)>" |
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
#!/bin/bash | |
## | |
## usage: bash -c "$( curl -fsSL https://gist.githubusercontent.com/jormungand/5dc331551f3c34346509eb36b27012e6/raw/ )" | |
## | |
## credits: http://apple.stackexchange.com/a/123738, https://stackoverflow.com/a/26492632 | |
## | |
_tmpdir="$( mktemp -d )" |
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
- (IBAction)addInsets:(id)sender | |
{ | |
[UIView animateWithDuration:0.3 animations:^{ | |
self.topLayoutGuide.length = self.topLayoutGuide.length > 0.0 ? 0.0 : 100.0; | |
[self.map setNeedsLayout]; | |
[self.map layoutIfNeeded]; | |
[self.map setCenterCoordinate:self.map.userLocation.coordinate animated:YES]; |