2020年初因为武汉肺炎爆发,所以在家办公,公司给配置了L2TP的VPN,但是我不想所有流量都走VPN(VPN比较慢而且也节省流量),于是想到用路由表给VPN分流。
具体的方案就是公司内网的流量走VPN,外网流量走默认网关。
我是在macOS上操作的,其他平台应该也差不多。
假设:
公司内网 192.168.10.0/24
家里网络 192.168.1.0/24
你已经配置好VPN并且可以使用了。
/* | |
* https://github.com/netnr/workers | |
* | |
* 2019-10-12 - 2022-05-05 | |
* netnr | |
* | |
* https://github.com/Rongronggg9/rsstt-img-relay | |
* | |
* 2021-09-13 - 2022-05-29 | |
* modified by Rongronggg9 |
extension Task where Failure == Error { | |
// Start a new Task with a timeout. If the timeout expires before the operation is | |
// completed then the task is cancelled and an error is thrown. | |
init(priority: TaskPriority? = nil, timeout: TimeInterval, operation: @escaping @Sendable () async throws -> Success) { | |
self = Task(priority: priority) { | |
try await withThrowingTaskGroup(of: Success.self) { group -> Success in | |
group.addTask(operation: operation) | |
group.addTask { | |
try await _Concurrency.Task.sleep(nanoseconds: UInt64(timeout * 1_000_000_000)) |
(function() { | |
'use strict'; | |
const el = new Image(); | |
let consoleIsOpen = false; | |
let consoleOpened = false; | |
Object.defineProperty(el, 'id', { | |
get: () => { | |
consoleIsOpen = true; | |
} |
#! Aaaaaaaaaaa this is JS!!! | |
// https://github.com/tc39/proposal-hashbang | |
// This file is mixing all new syntaxes in the proposal in one file without considering syntax conflict or correct runtime semantics | |
// Enjoy!!! | |
// Created at Nov 23, 2018 | |
for await(const x of (new A // https://github.com/tc39/proposal-pipeline-operator | |
|> do { // https://github.com/tc39/proposal-do-expressions | |
case(?) { // https://github.com/tc39/proposal-pattern-matching | |
when {val}: class { |
2020年初因为武汉肺炎爆发,所以在家办公,公司给配置了L2TP的VPN,但是我不想所有流量都走VPN(VPN比较慢而且也节省流量),于是想到用路由表给VPN分流。
具体的方案就是公司内网的流量走VPN,外网流量走默认网关。
我是在macOS上操作的,其他平台应该也差不多。
假设:
公司内网 192.168.10.0/24
家里网络 192.168.1.0/24
你已经配置好VPN并且可以使用了。
%GetOptimizationStatus
return a set of bitwise flags instead of a single value,
to access the value, you need to take the binary representation of the returned value.
Now, for example, if 65
is returned, the binary representation is the following:
(65).toString(2).padStart(12, '0');
// 000001000001
Each binary digit acts as a boolean with the following meaning:
# Set build arguments here. See `gn help buildargs`. | |
is_debug = false | |
symbol_level = 0 | |
blink_symbol_level = 0 | |
is_component_build = false | |
# enable_resource_allowlist_generation=true requires symbol_level >= 1 | |
# enable_resource_whitelist_generation = false | |
enable_resource_allowlist_generation = false |
import UIKit | |
import AVKit | |
class VideoView: UIView { | |
// video layer that will stream the url | |
private let videoLayer = AVPlayerLayer() | |
// pan gesture used for scrubbing | |
private let panGesture = UIPanGestureRecognizer() |
// my brain decided to ask the question: yknow, i want you to think about the y combinator -- | |
// like, what is it. like what the fuck girl, cmon, you have a comp sci degree, you should know this, and understand it and shit | |
// and so i was like fiiiiiiiiiiiiiiine gosh, lets see if typescript can handle the typing, and play around with it | |
// so i looked up a javascript implementation, and played with the type defintion until it | |
// matched up and then i was like oh: thats what the type definition of the functions in it are. | |
// i get it now. that's pretty cool. the main interesting thing is a the inner function that takes itself | |
// and returns the function initially passed to the outer function. neato. |