Skip to content

Instantly share code, notes, and snippets.

@saitomarch
saitomarch / bootstrap.sh
Last active May 18, 2020 22:08
Bootstrap scripts to install depended packages (which provided on RubyGems Bundler, CocoaPods, Carthage and NPM) automatically for macOS/iOS App Project.
#!/bin/sh
usage_exit() {
echo "Usage: $0 [-u] [-c]" 1>&2
echo " -u: Update packages"
echo " -c: Clean caches"
exit 1
}
abort() {
@saitomarch
saitomarch / viewport_injection.swift
Created January 19, 2017 09:09
WKWebView JavaScript Injection to block zoom.
// Remember to import WebKit at the top of the file
let source = "var meta = document.createElement('meta');" +
"meta.name = 'viewport';" +
"meta.content = 'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no';" +
"var head = document.getElementsByTagName('head')[0];" +
"head.appendChild(meta);"
let userContentController = WKUserContentController()
userContentController.addUserScript(script)