This file contains hidden or 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 FormRendererView_Previews: PreviewProvider { | |
static var previews: some View { | |
FormRendererView_Previews.feedbackExample | |
} | |
static var feedbackExample: some View { | |
FormRendererView( | |
submitButtonTitle: "Send Feedback", | |
formFields: [ | |
FormFieldConfiguration( |
This file contains hidden or 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
/* Example | |
ZStack(alignment: .top) { | |
ForEach(cardModels, id: \.id) { model in | |
CardView(model) | |
.swipeable { swipedRight in | |
// store.swipe(swipedRight) | |
} | |
} | |
} | |
*/ |
This file contains hidden or 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
extension String { | |
static func friendlyId(length: Int = 22) -> String { | |
let alphabets = Array("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789") | |
var friendlyId = "" | |
for _ in 1...length { | |
friendlyId.append(alphabets[Int.random(in: 0...alphabets.count - 1)]) | |
} | |
return friendlyId | |
} | |
} |
This file contains hidden or 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
let isLoading: Driver<Bool> | |
isLoading.drive(weatherIconView.rx.isHidden).disposed(by: bag) | |
isLoading.drive(pressureLabel.rx.isHidden).disposed(by: bag) | |
isLoading.drive(precipitationLabel.rx.isHidden).disposed(by: bag) | |
isLoading.drive(windSpeedLabel.rx.isHidden).disposed(by: bag) | |
isLoading.drive(windDirectionLabel.rx.isHidden).disposed(by: bag) | |
isLoading.drive(humidityLabel.rx.isHidden).disposed(by: bag) |
This file contains hidden or 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
// Rewrite from FLEX | |
import RxCocoa | |
import RxGesture | |
import RxSwift | |
// https://github.com/Flipboard/FLEX/blob/master/Classes/ExplorerInterface/FLEXExplorerViewController.m#L611 | |
var overlay: UIWindow? | |
func findViews(at point: CGPoint, ignoreHidden: Bool = true) -> [UIView] { | |
return UIApplication.shared.windows |
This file contains hidden or 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
<div class="h-100 bg-near-white pa4 ba bw1 ma4"> | |
<div class="f3 b avenir pv2">Bo$ka</div> | |
<div class="f4 avenir pv2"> | |
<p>Venom was give them what they code venom, So Eminem Just call them Venom, For them venom is they can only drink them. | |
</p> | |
</div> | |
<div class="f4 avenir pv4">Sincerely, Mathew Mathers</div> | |
</div> |
This file contains hidden or 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
{ | |
"roles": [ | |
{ | |
"user": { | |
"email": "[email protected]", | |
"name": "bob" | |
}, | |
"role": "Director", | |
"role_description": "role_description", | |
"fuctions": ["Function 1", "Function 2"], |
This file contains hidden or 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
{ | |
"roles": [ | |
{ | |
"user": { | |
"email": "[email protected]", | |
"name": "bob" | |
}, | |
"role": "Director", | |
"role_description": "role_description", | |
"fuctions": ["Function 1", "Function 2"], |
This file contains hidden or 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
pragma solidity 0.4.11; | |
contract Offer { | |
/* Constructor */ | |
address public employee; | |
uint public safetyDeposit; | |
uint public offerStart; | |
uint public lastWithdraw; | |
uint public numberBlocksPerDay = 2; | |
uint public ratePerDay = 0.5 ether; | |
event Withdraw(address employee, uint amount, uint numberOfDay); |
This file contains hidden or 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
extension URL { | |
func fetch(completionHandler: ((Data) -> ())? = nil) { | |
print("Request: \(self)") | |
URLSession.shared.dataTask(with: self) { | |
guard | |
let response = $1 as? HTTPURLResponse, response.statusCode == 200, | |
let data = $0, $2 == nil | |
else { return } | |
completionHandler?(data) | |
}.resume() |
NewerOlder