Skip to content

Instantly share code, notes, and snippets.

View nerzh's full-sized avatar
💾
cmd+s

OleH. nerzh

💾
cmd+s
View GitHub Profile
@nerzh
nerzh / WKWebViewEventListener.swift
Created November 17, 2023 15:56 — forked from iosappdeveloper/WKWebViewEventListener.swift
Add event listener from iOS code and then get callback in native code
func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage) {
print("\(#function): \(message)")
}
func setupSubViews() {
let configurations = WKWebViewConfiguration()
let controller = WKUserContentController()
let myEventScriptString =
"""
var elements = document.getElementsByClassName('button');
@nerzh
nerzh / gist:5b6b94eb23cd65cb594e07e1d4f381e4
Last active October 15, 2023 14:14
Swift Process with password
public enum Arguments {
case command(Command)
case array([String])
case path(String)
case sudo(Password)
case environment([String: String])
}
public extension Arguments {
enum Command: ExpressibleByStringLiteral, CustomStringConvertible {
te6ccgICAsYAAQAAaqAAAAFJAAAAF8pT+T+Q5ANeB4TWQWW23ZCBXjD5E7Syn29UFPD/Gsj9QAABAgPNQAJTAAICAc4BLgADAQFIAAQBKxJkIK6OZCGujgCVAGQP////////usAABQICyAAvAAYCAWIAEAAHAgFIAAkACACb05x0CTxS9PlAJm2Sm6UbwneK7TMQ6oK3o7IDucuH2jB7ccvgMGgAYPu8cXWD8WnxC+vfIJLal6yNStWedzyeBdmwY0oCThnMvNby76YcAgEgAA0ACgIBIAAMAAsAmxzjoEnilrOXwQ8II7I2j4DG3Q3AByT0R2DrLWmDoLk1ibntTFqAAwkbQVvbxYFG3fSj35GbpJarZwBkP4GaZXaUOwVUMYZtc9b2njnJoACbHOOgSeKiSvL1SYaFPDrt0BNXSIr+4nI4fv3nsPZ7FW4/Leb63QADNQIPyQEjATanPCu3zYE2UD35GVEhz+vih91ywBqxswy+2FF/1crgAgEgAA8ADgCbHOOgSeKajXqJ/raNNXcbxAsYRo/l3qeeU/+uflx4VQi1SNAPbcADPuf5FWr8gMFBQ8Fl1zTZpeaon+EeJnFU96QB4VwWmJnCW9l8IntgAJsc46BJ4o/TnIFjk+wie3917lSkBI9/YEcLutoHS2l7bKdF816nwANIK1mrfp5Ait1QpTGfaBIbOfAIWz55SwEk3qeE6to+zL6fHogBsGACASAAIAARAgEgABkAEgIBIAAWABMCASAAFQAUAJsc46BJ4pg8YnTPEahdlyvr+gxtF/XXwpYFRf+RxjF/11X2qwpHwANLozU8TbiJ2aNceUdXbTstUgnArGzIYBF1bgI9XP+fWp2oeS6l7qAAmxzjoEnigrcUFS0lQnG7OenJhSHMzQ1o8k04j/otIAZHNxWQBoRAA1PTpbQ5QXfvm1SJAdgjPn3doa1hleqoCkkoxhj4c98vFBtFWbhmIAIBIAAYABcAmxzjoEnik43vS0h4WyTz067Qo2miECJe/K2w
{
"$schema": "https://raw.githubusercontent.com/broxus/flatqube-assets/master/schemas/manifest.json",
"name": "FlatQube Tokens List",
"version": {
"major": 0,
"minor": 0,
"patch": 3
},
"keywords": [
"ton",
struct S: Encodable {}
extension Encodable {
var nnn: Int { return 1 }
}
protocol B {
static func test<T: Encodable>(_ value: T) -> Int
}