This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const deasync = require("deasync"); | |
module.exports = function importSync(moduleName, options) { | |
let ok; | |
let result; | |
import(moduleName, options) | |
.then((mod) => { | |
ok = true; | |
result = mod; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { parse } from "@babel/parser"; | |
import traverse from "@babel/traverse"; | |
import generate from "@babel/generator"; | |
import * as t from "@babel/types"; | |
function isBareSpecifier(specifier: string) { | |
// check if is relative or absolute path | |
if (specifier.match(/^\.*\//)) return false; | |
try { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { brotliDecompress } from "node:zlib"; | |
import { promisify } from "node:util"; | |
const baseURL = "https://www2.deepl.com"; | |
const brotliDecompressAsync = promisify(brotliDecompress); | |
class JSONRPCRequest { | |
public readonly jsonrpc = "2.0" as const; | |
public readonly method: string; | |
public readonly params: object; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# 使用errexit, nounset, pipefail选项,启用nullglob扩展 | |
set -o errexit -o nounset -o pipefail | |
shopt -s nullglob | |
# 设置btrfs路径和cgroup | |
btrfs_path='/var/bocker' && cgroups='cpu,cpuacct,memory' | |
# 解析命令行参数,将`--key=value`转换为`BOCKER_key=value`,`--key`转换为`BOCKER_key=x` | |
[[ $# -gt 0 ]] && while [ "${1:0:2}" == '--' ]; do | |
OPTION=${1:2} | |
[[ $OPTION =~ = ]] && declare "BOCKER_${OPTION/=*/}=${OPTION/*=/}" || declare "BOCKER_${OPTION}=x" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>Simple ACE Example</title> | |
<style type="text/css" media="screen"> | |
body { | |
margin: 0; | |
height: 100vh; | |
display: grid; | |
grid-template-rows: auto 1fr; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<title>Tesseract</title> | |
<style> | |
@import url(https://jsd.cdn.zzko.cn/npm/landsoul); | |
body { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<link | |
rel="preload" | |
as="style" | |
href="https://registry.npmmirror.com/github-markdown-css/latest/files" | |
/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
</head> | |
<body> | |
<h1>Render image as <div><small>s</small></h1> | |
<input type="file" accept="image/*" /> | |
<br /> |
NewerOlder