- read this first: https://www.webkit.org/blog/3476/content-blockers-first-look/
- start by adding a new extension target to your iOS app of type “content blocker”
- launch the app using the main target’s scheme + a call to
SFContentBlockerManager.reloadContentBlockerWithIdentifier()
with the extension’s id inapplication:didFinishLaunchingWithOptions:
to auto-reload the blocker in development mode - if you don’t call
reloadContentBlockerWithIdentifier()
then you need to switch the blocker off and on again in the Safari settings (stop the app in Xcode if the switch is not moving) - use inspector from desktop Safari to inspect the Safari in the simulator in order to find specific things to block
- things like periods in the
url-filter
regexp need to be escaped with double backslashes, e.g.facebook\\.net
- if you use
if-domain
, it needs to be an array, even for one element - domain
foo.com
might not matchwww.foo.com
even though I think it’s supposed to (UPDATE: They've changed it in one of
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
// | |
// TextStyle.swift | |
// | |
// Created by Rob Napier on 12/20/19. | |
// Copyright © 2019 Rob Napier. All rights reserved. | |
// | |
import SwiftUI | |
public struct TextStyle { |
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
function injectGitFileStatus() | |
{ | |
const timeout = 5000; | |
const addedColor = "#8dc149"; | |
const modifiedColor = "#cbcb41"; | |
const stagedColor = "#ca2820"; | |
const ignoredOpacity = "0.4"; | |
const explorer = document.getElementById("workbench.view.explorer"); | |
if (explorer) |
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
// Great for getting values, outputting context strings, and so on. | |
console.log(variable) | |
// Same as console.log(), but prints in yellow as a warning. Useful to show a non-breaking error in a dev env. | |
console.warn('It is a good idea to use .map instead of a for-loop.') | |
// Same as console.log(), but prints in red as an error. Useful to show a breaking error in a dev env. | |
console.error(`The value must be an integer. You provided a ${typeof variable}.`) | |
// Group console data together for better viewing. Nice to group console logs together. |
To get Semantic UI fonts working:
-
npm install semantic-ui-css
-
Import
'semantic-ui-css/semantic.css'
in your entry script. The exact syntax for this varies depending on your chosen module format:import
for ES6,require
for CommonJS, etc. This tells Webpack to pull the CSS into your bundle. -
npm install --save-dev style-loader css-loader
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
#quotes on json, single around entire object and double on each property | |
aws lambda update-function-configuration --function-name=[lambda function name] --environment '{"Variables":{"abc":"124"}}' |
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
#!/bin/bash | |
killall Xcode | |
xcrun -k | |
xcodebuild -alltargets clean | |
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache" | |
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang.$(whoami)/ModuleCache" | |
rm -rf ~/Library/Developer/Xcode/DerivedData/* | |
rm -rf ~/Library/Caches/com.apple.dt.Xcode/* | |
open /Applications/Xcode.app |
- read this first: https://www.webkit.org/blog/3476/content-blockers-first-look/
- start by adding a new extension target to your iOS app of type “content blocker”
- launch the app using the main target’s scheme + a call to
SFContentBlockerManager.reloadContentBlockerWithIdentifier()
with the extension’s id inapplication:didFinishLaunchingWithOptions:
to auto-reload the blocker in development mode - if you don’t call
reloadContentBlockerWithIdentifier()
then you need to switch the blocker off and on again in the Safari settings (stop the app in Xcode if the switch is not moving) - use inspector from desktop Safari to inspect the Safari in the simulator in order to find specific things to block
- things like periods in the
url-filter
regexp need to be escaped with double backslashes, e.g.facebook\\.net
- if you use
if-domain
, it needs to be an array, even for one element - domain
foo.com
might not matchwww.foo.com
even though I think it’s supposed to (UPDATE: They've changed it in one of
NewerOlder