Skip to content

Instantly share code, notes, and snippets.

@sunlei
sunlei / obsidian-web-clipper.js
Created November 16, 2021 10:11 — forked from kepano/obsidian-web-clipper.js
Obsidian Web Clipper Bookmarklet to save articles and pages from the web (for Safari, Chrome, Firefox, and mobile browsers)
javascript: Promise.all([import('https://unpkg.com/turndown@6.0.0?module'), import('https://unpkg.com/@tehshrike/readability@0.2.0'), ]).then(async ([{
default: Turndown
}, {
default: Readability
}]) => {
/* Optional vault name */
const vault = "";
/* Optional folder name such as "Clippings/" */
#!/bin/bash
# For *nix users, just run iptables.shadow
# For OpenWRT users, copy iptables.shadow to /etc/firewall.user
# For OpenWRT users, remember to change OUTPUT to PREROUTING in iptables.footer
./generate.sh route_table > analysis_result
node minifier.js|node formatter.js --profile=custom --format="iptables -t nat -A SHADOWSOCKS -d %prefix/%mask -j %gw" --netgw RETURN --vpngw ACCEPT > iptables.rules
var PROXY = 'SOCKS5 127.0.0.1:10007';
var PROXY_HOSTS = [
/* google */
'google.com', 'googleusercontent.com', 'gstatic.com', 'ggpht.com', 'googleapis.com',
'googlecode.com', 'google.co.id', 'googleadservices.com',
/* other */
'godaddy.com', 'blogger.com', 'blogspot.jp', 'youtu.be', 'goo.gl', 'facebook.com',
'feedsportal.com', 'cloudfront.net', 'alexa.com', 's3.amazonaws.com', 'cl.ly', 'yfrog.com',
#!/usr/local/python/bin
# coding=utf-8
'''Implements a simple log library.
This module is a simple encapsulation of logging module to provide a more
convenient interface to write log. The log will both print to stdout and
write to log file. It provides a more flexible way to set the log actions,
and also very simple. See examples showed below: