source neardev/dev-account.env
export CONTRACT_NAME=$CONTRACT_NAME
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
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.4; | |
abstract contract Context { | |
function _msgSender() internal view virtual returns (address payable) { | |
return payable(msg.sender); | |
} | |
function _msgData() internal view virtual returns (bytes memory) { |
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
Visit this website by Safari mobile and tap to the buttion "Find My UDID": http://udid.store. | |
You don't need the iTunes or plug your cable into the Mac. |
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 measure(title: String!, call: () -> Void) { | |
let startTime = CACurrentMediaTime() | |
call() | |
let endTime = CACurrentMediaTime() | |
if let title = title { | |
print("\(title): ") | |
} | |
print("Time - \(endTime - startTime)") | |
} |
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 openURL(url: String) { | |
var responder: UIResponder = self | |
while responder.nextResponder() != nil { | |
responder = responder.nextResponder()! | |
NSLog("responder = %@", responder) | |
if responder.respondsToSelector("openURL:") == true { | |
responder.performSelector("openURL:", withObject: NSURL(string: url)) | |
} | |
} | |
} |
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 Foundation | |
extension String | |
{ | |
// Works in Xcode but not Playgrounds because of a bug with .insert() | |
mutating func insertString(string:String,ind:Int) { | |
var insertIndex = advance(self.startIndex, ind, self.endIndex) | |
for c in string { |