Skip to content

Instantly share code, notes, and snippets.

View dlpigpen's full-sized avatar
🎯
Focusing

MD dlpigpen

🎯
Focusing
View GitHub Profile
@dlpigpen
dlpigpen / sol
Created September 24, 2022 00:46
GoodDoge
// 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) {
@dlpigpen
dlpigpen / clear_state_of_contract_on_near_protocol.md
Created July 11, 2022 11:11 — forked from ilyar/clear_state_of_contract_on_near_protocol.md
How do clear the state of a contract on Near protocol?

How do clear the state of a contract on Near protocol?

Prepare

source neardev/dev-account.env
export CONTRACT_NAME=$CONTRACT_NAME

View state

@dlpigpen
dlpigpen / gist:fb2830e79ff6b395f17b6f23a9b50007
Last active August 29, 2017 11:39
Get UDID of iPhone or iPad by single tap without iTunes
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.
@dlpigpen
dlpigpen / Measure.swift
Created June 22, 2016 08:06 — forked from kostiakoval/Measure.swift
Measure Speed in Swift
func measure(title: String!, call: () -> Void) {
let startTime = CACurrentMediaTime()
call()
let endTime = CACurrentMediaTime()
if let title = title {
print("\(title): ")
}
print("Time - \(endTime - startTime)")
}
@dlpigpen
dlpigpen / gist:49ce68cb435c93530305
Created December 10, 2015 02:07 — forked from ikhanhmai/gist:b9a2c3a3263db8d9e9ac
iOS - openURL from Custom Keyboard Extension
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))
}
}
}
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 {