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
### Keybase proof | |
I hereby claim: | |
* I am tempire on github. | |
* I am tempire (https://keybase.io/tempire) on keybase. | |
* I have a public key ASDIRg2rJmI_Ly2SlcDphF4jfba_l3Hw2MbSHaFm0wlQZwo | |
To claim this, I am signing this object: |
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
// In the MTR view controller | |
let vc = storyboard.instantiateViewController(withIdentifier: "WebViewController") | |
self.navigationController?.pushViewController(vc, animated: true) | |
// Web View Controller, assuming a matching view controller in the storyboard | |
class WebViewController: UIViewController { |
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
map $http_upgrade $connection_upgrade { | |
default "upgrade"; | |
"" ""; | |
} | |
server { | |
listen 80; | |
location / { | |
proxy_pass http://docker; |
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
#!/usr/bin/env perl | |
use Data::Printer colored => 1; | |
use Modern::Perl; | |
use Mojo::JSON; | |
my @in; | |
say $_ ? p($_) : @in for Mojo::JSON->new->decode(@in = <STDIN>) |
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
import RealmSwift | |
class ParentThing: Object { | |
dynamic var name: String = "" | |
dynamic var oktaId: String = "" | |
dynamic var employeeId: String = "" | |
dynamic var salesforceId: String = "" | |
dynamic var someOptionalThing: String? |
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
var loginButton = (self.facebookLoginView.subviews.filter({ $0 is UIButton }) as Array).first as UIButton | |
// Tells auto-layout that we're doing this in code, specifying everything | |
self.facebookLoginView.setTranslatesAutoresizingMaskIntoConstraints(false) | |
// V:|-(60)-[facebookLoginView(100)] | |
let loginHeight = NSLayoutConstraint( | |
item: self.facebookLoginView, | |
attribute: NSLayoutAttribute.Height, | |
relatedBy: NSLayoutRelation.Equal, |
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
// From Ray Wenderlich, converted to swift 2 | |
extension Structs: CustomStringConvertible { | |
var description: String { | |
return contents.description | |
} | |
} | |
extension Structs: ArrayLiteralConvertible { | |
init(arrayLiteral elements: Element...) { |
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
// Allows | |
// Storyboard.Main.viewController(MainVC) | |
enum Storyboard: String { | |
case Main | |
static let values = [Main] | |
static var boards = [Storyboard:UIStoryboard]() | |
func viewController<A: UIViewController>(type: A.Type) -> A { |
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)setHighlighted:(BOOL)highlighted animated:(BOOL)animated duration:(NSTimeInterval)duration completion:(void(^)(BOOL finished))completion { | |
void (^highlight)(UIView *, BOOL) = ^void(UIView *view, BOOL highlight) { | |
if (highlight) { | |
view.layer.borderWidth = 0.0; | |
view.layer.borderColor = [UIColor clearColor].CGColor; | |
view.layer.shadowOpacity = 0.0; | |
} | |
else { |
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
use Modern::Perl; | |
use Mojo::Template; | |
use Mojo::Loader; | |
say Mojo::Template->new->render(Mojo::Loader->new->data(__PACKAGE__, 'hello'), | |
qw/ glen hinkle /); | |
__DATA__ | |
@@ hello | |
% my ($fname, $lname) = @_; |