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
{ | |
"campaign": { | |
"uuid": "ed43c9de-ce4d-4924-a7fe-0714e4ced77e", | |
"network": "eth", // e.g. eth, polygon, tt, bnb | |
"name": "campaign name", | |
"description": "campaign descritpion", | |
"validated_description": "validated!", | |
"redeemed_description": "redeemed!", | |
"image_url": "https://mainnet-cdn.redreamer.io/logo.png", | |
"contract_addresses": [ |
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 CustomTableViewCellModel { | |
let title: String | |
let content: String? | |
} | |
class CustomTableViewCell: UITableViewCell { | |
@IBOutlet weak var titleLabel: UILabel! | |
@IBOutlet weak var contentTextView: UITextView! | |
var viewModel: CustomTableViewCellModel? { |
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
protocol SomeProtocol { | |
associatedtype SomeType: Decodable | |
var bar: String { get } | |
} | |
struct Foo: SomeProtocol { | |
struct SomeType: Decodable { | |
let bar: 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 token = ""; | |
function doPost(request) { | |
if (token != request.parameter.token) { | |
return; | |
} | |
const text = request.parameter.text; | |
const textForSlack = getAdSenseResponse(text); | |
const response = {"response_type": "in_channel", "text": textForSlack}; | |
return ContentService.createTextOutput(JSON.stringify(response)).setMimeType(ContentService.MimeType.JSON); |
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
extension UUID { | |
enum UUIDVersion: Int { | |
case v3 = 3 | |
case v5 = 5 | |
} | |
enum UUIDv5NameSpace: String { | |
case dns = "6ba7b810-9dad-11d1-80b4-00c04fd430c8" | |
case url = "6ba7b811-9dad-11d1-80b4-00c04fd430c8" | |
case oid = "6ba7b812-9dad-11d1-80b4-00c04fd430c8" |
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 htmlString = NSMutableAttributedString() | |
do { | |
if let data = self.data(using: String.Encoding.unicode, allowLossyConversion: true) { | |
htmlString = try NSMutableAttributedString(data: data, options: [.documentType: NSAttributedString.DocumentType.html], documentAttributes: nil) | |
} | |
} catch { | |
print(error) | |
} |
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 application(_ application: UIApplication, performActionFor shortcutItem: UIApplicationShortcutItem, completionHandler: @escaping (Bool) -> Void) |
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 init(type: String, localizedTitle: String, localizedSubtitle: String?, icon: UIApplicationShortcutIcon?, userInfo: [AnyHashable : Any]? = nil) |
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
private func scaleMapImage(_ image: UIImage?, size: CGSize) -> UIImage? { | |
guard let image = image else { | |
return nil | |
} | |
UIGraphicsBeginImageContext(CGSize(width: size.width, height: 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
if let url = Bundle.main.url(forResource: ImageName, withExtension: ".png"), | |
let data = try? Data(contentsOf: url, | |
options: Data.ReadingOptions.uncached) { | |
let image = UIImage(data: data) | |
imageView.image = image | |
} |
NewerOlder