Skip to content

Instantly share code, notes, and snippets.

struct FixedSpacer: View {
var length: Length
var body: some View {
Spacer()
.frame(minHeight: 0, maxHeight: length)
}
init(_ length: Length = 0) {
self.length = length
}
}
@seankovacs
seankovacs / gist:c264b499359dfca8e20183c38650e613
Created November 30, 2016 22:10
Storyboard friendly UIButton with centered text and image
Adjusting the edge insets screws up the intrinsic size of the button, causing the hit area to be skewed.
// UICenteredButton.h
// Created by Sean Kovacs on 6/9/15.
#import <UIKit/UIKit.h>
IB_DESIGNABLE
@interface UICenteredButton : UIButton
@seankovacs
seankovacs / gist:bb4fe2164dc9767dee0d
Last active October 22, 2018 17:30
Google Voice internal OAuth2 API
Oauth2 Scope:
https://www.googleapis.com/auth/googlevoice
+https://www.googleapis.com/auth/contacts
+https://www.googleapis.com/auth/userinfo.email
+https://www.googleapis.com/auth/userinfo.profile
+https://www.googleapis.com/auth/googletalk
++++ Folder/Label counts
POST /rpc?prettyprint=false HTTP/1.1
Host: www.googleapis.com