Some might be outdated.
Taken from (404 as of today): https://macosxautomation.com/system-prefs-links.html
$ open "x-apple.systempreferences:com.apple.preference.security?General"
Some might be outdated.
Taken from (404 as of today): https://macosxautomation.com/system-prefs-links.html
$ open "x-apple.systempreferences:com.apple.preference.security?General"
const http = require("http"); | |
const { parse } = require("basic-auth"); | |
const { PROXY_USERNAME, PROXY_PASSWORD } = process.env; | |
const PROXY_PORT = process.env.PROXY_PORT || 8000; | |
const check = (credentials) => { | |
return ( | |
credentials && | |
credentials.username === PROXY_USERNAME && | |
credentials.pass === PROXY_PASSWORD |
/** | |
* Source: https://gist.github.com/Ephys/79974c286e92665dcaae9c8f5344afaf | |
*/ | |
import { useState, useEffect, useCallback, useRef } from 'react'; | |
const eventTargets = new WeakMap(); | |
function getEventTarget(storage: Storage) { | |
if (eventTargets.has(storage)) { |
import React from "react"; | |
import Counter from "./Counter"; | |
const App = () => { | |
return ( | |
<div className="App"> | |
<Counter initialCount={100} /> | |
</div> | |
); | |
}; |
国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。
Dockerized 实践 https://github.com/y0ngb1n/dockerized
#!/usr/bin/env node | |
const PPT = require('puppeteer'); | |
const PDD = require('puppeteer/DeviceDescriptors'); | |
const PuppeteerHar = require('puppeteer-har'); | |
(async () => { | |
const ua = await PPT.launch({ | |
headless: true, | |
args: ['--no-sandbox', '--disable-gpu'], |
server { | |
listen 80; | |
# maps p8080.example.com -> localhost:8080 | |
server_name ~^p(?<port>[^.]+)\.example\.com$; | |
location / { | |
proxy_pass http://localhost:$port; | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; |
So there were a few threads going around recently about a challenge to write the longest sequence of keywords in Javascript:
There are, however, a few problems:
async function readStdinSync() { | |
return new Promise(resolve => { | |
let data = '' | |
process.stdin.setEncoding('utf8') | |
process.stdin.resume() | |
const t = setTimeout(() => { | |
process.stdin.pause() | |
resolve(data) | |
}, 1e3) | |
process.stdin.on('readable', () => { |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>OCR Sample</title> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script> | |
</head> | |
<body> | |
<script type="text/javascript"> | |
function processImage() { |