Skip to content

Instantly share code, notes, and snippets.

@LeeKahSeng
LeeKahSeng / webview-inject-javascript-full.swift
Last active February 27, 2023 17:41
Sample code for "Injecting JavaScript Into Web View In iOS" (https://swiftsenpai.com/development/web-view-javascript-injection/)
import UIKit
import WebKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Configure the web view for JavaScript injection
configureWebView()
//
// DirectedPolylineViewController.swift
//
//
// Created by Mac OS X on 11/02/2020.
// Copyright © 2020 Muhammad Zeeshan. All rights reserved.
//
import UIKit
import GoogleMaps
@barsumek
barsumek / introspectionQuery.txt
Created November 22, 2018 12:42
Detox your GraphQL: Introspection Query
query IntrospectionQuery {
__schema {
queryType {
name
}
mutationType {
name
}
types {
...FullType
@zthxxx
zthxxx / Activate Office 2019 for macOS VoL.md
Last active July 23, 2024 19:37
crack activate Office on mac with license file
@insidegui
insidegui / WebCacheCleaner.swift
Created September 14, 2016 23:12
Clear WKWebView's cookies and website data storage, very useful during development.
import Foundation
import WebKit
final class WebCacheCleaner {
class func clean() {
HTTPCookieStorage.shared.removeCookies(since: Date.distantPast)
print("[WebCacheCleaner] All cookies deleted")
WKWebsiteDataStore.default().fetchDataRecords(ofTypes: WKWebsiteDataStore.allWebsiteDataTypes()) { records in
@mmazzarolo
mmazzarolo / RadioButton.js
Last active May 26, 2021 15:29
Simple animated stateless React-Native radio button
import React, { PropTypes } from 'react'
import { StyleSheet, TouchableOpacity } from 'react-native'
import { View } from 'react-native-animatable'
const DEFAULT_SIZE_MULTIPLIER = 0.7
const DEFAULT_OUTER_BORDER_WIDTH_MULTIPLIER = 0.2
const RadioButton = ({ size, innerColor, outerColor, isSelected, onPress, ...props }) => {
const outerStyle = {
borderColor: outerColor,
@interface ExtendedManagedObject : NSManagedObject {
BOOL traversed;
}
@property (nonatomic, assign) BOOL traversed;
- (NSDictionary*) toDictionary;
- (void) populateFromDictionary:(NSDictionary*)dict;
+ (ExtendedManagedObject*) createManagedObjectFromDictionary:(NSDictionary*)dict
inContext:(NSManagedObjectContext*)context;