You hardly ever have to use the word true
in your code.
if (something == true)
# do something cool
end
Can be rewritten as
(function(console){ | |
console.save = function(data, filename){ | |
if(!data) { | |
console.error('Console.save: No data') | |
return; | |
} | |
if(!filename) filename = 'console.json' |
SFContentBlockerManager.reloadContentBlockerWithIdentifier()
with the extension’s id in application:didFinishLaunchingWithOptions:
to auto-reload the blocker in development modereloadContentBlockerWithIdentifier()
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)url-filter
regexp need to be escaped with double backslashes, e.g. facebook\\.net
if-domain
, it needs to be an array, even for one elementfoo.com
might not match www.foo.com
even though I think it’s supposed to (UPDATE: They've changed it in one of#!/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 |
#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"}}' |
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
// 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. |
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) |
// | |
// TextStyle.swift | |
// | |
// Created by Rob Napier on 12/20/19. | |
// Copyright © 2019 Rob Napier. All rights reserved. | |
// | |
import SwiftUI | |
public struct TextStyle { |