Forked from: https://gist.github.com/gboudreau/94bb0c11a6209c82418d01a59d958c93
Differences:
- Outputs items sorted by site/name
- Fixed QR codes outputting twice for every entry
- No support for saving to a .json file
// 2023.4.23 更新,修复 gtag.js 加了个回车导致失效的问题 | |
// 2023.3.2 更新,修复上报到 region*.google-analytics.com 未被代理的问题 | |
addEventListener('fetch', (event) => { | |
// 这里可以加 filter | |
return event.respondWith(handleRequest(event)); | |
}); | |
// worker 应用的路由地址,末尾不加 '/' | |
const DOMAIN = 'https://example.workers.dev/routerpath'; |
Forked from: https://gist.github.com/gboudreau/94bb0c11a6209c82418d01a59d958c93
Differences:
// silence dart-sass / npm sass DEPRECATION WARNING: Using / for division outside of calc() is deprecated and will be removed in Dart Sass 2.0.0. | |
const silenceSomeSassDeprecationWarnings = { | |
verbose: true, | |
logger: { | |
warn(message, options) { | |
const { stderr } = process; | |
const span = options.span ?? undefined; | |
const stack = (options.stack === 'null' ? undefined : options.stack) ?? undefined; |
// download .bash_local_aliases file and cd to the download directory | |
$ cp .bash_local_aliases ~/ | |
$ if ! grep -qF 'source ~/.bash_local_aliases' ~/.bashrc; then echo -e "\nsource ~/.bash_local_aliases" >> ~/.bashrc; fi | |
$ source ~/.bash_local_aliases && cd . | |
// place a .aliases file anywhere, in the space-delimited "alias command" format shown in the .aliases example in this gist | |
// IMPORTANT: .aliases file should end with a single blank, empty line | |
$ cd . |
#! /bin/bash | |
# Run epson-printer-utility from epson-printer-utility_1.0.2-1lsb3.2_amd64.deb | |
# using downloaded libqt4 libraries from previous Ubuntu version (not provided | |
# in Ubuntu 20.04 "focal fossa" | |
# | |
# This downloads the deb files and extracts them in a libs directory in the | |
# current directory, and then runs the utility | |
# | |
# Fix for: |
#!/bin/sh | |
# Adds an IP to Cloudflare IP block list | |
# Path: /var/ossec/active-response/bin/cloudflare-ban.sh | |
# | |
ACTION=$1 | |
USER=$2 | |
IP=$3 | |
PWD=`pwd` | |
TKN='CF API KEY' |
{"lastUpload":"2020-09-28T15:20:26.168Z","extensionVersion":"v3.4.3"} |
/** | |
* Open all external links in a new window | |
*/ | |
require(["jquery"], function($) { | |
var isInternalLink = new RegExp('/' + window.location.host + '/'); | |
$(document).on("click", "a", function() { | |
var t = $(this); | |
if (!isInternalLink.test(t.attr("href"))) { | |
t.attr('target', '_blank'); | |
} |
(function() { | |
var CSSCriticalPath = function(w, d, opts) { | |
var opt = opts || {}; | |
var css = {}; | |
var pushCSS = function(r) { | |
if(!!css[r.selectorText] === false) css[r.selectorText] = {}; | |
var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/); | |
for(var i = 0; i < styles.length; i++) { | |
if(!!styles[i] === false) continue; | |
var pair = styles[i].split(": "); |
var collectionNames = db.getCollectionNames(), stats = []; | |
collectionNames.forEach(function (n) { stats.push(db[n].stats()); }); | |
(function(){ stats = stats.sort(function(a, b) { return b['size'] - a['size']; }); })(); | |
for (var c in stats) { print(stats[c]['ns'] + ": " + stats[c]['size'] + " (" + stats[c]['storageSize'] + ")"); } |