Skip to content

Instantly share code, notes, and snippets.

View bxb100's full-sized avatar
😭
R.I.P, My friends

Lemon bxb100

😭
R.I.P, My friends
View GitHub Profile
@bxb100
bxb100 / highlights.svg
Created September 10, 2025 20:35
firefox sidebar chatbox icon
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import { createClient } from 'npm:@1password/sdk';
const decoder = new TextDecoder();
const runCli = async (args: string[] | string) => {
if (typeof args === 'string') {
args = [args]
}
const command = new Deno.Command("op", {
args: [...args],
@bxb100
bxb100 / Caddyfile
Created April 13, 2024 15:22
Dify Caddyfile
{$dify_host_name} {
header {
# Enable HTTP Strict Transport Security (HSTS) to force clients to always connect via HTTPS
Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
# Prevent some browsers from MIME-sniffing a response away from the declared Content-Type
X-Content-Type-Options "nosniff"
# X-Robots-Tag

Comparison of Spring Cloud with Eureka

I feel Consul.io does better in the following area:

  • The focus on scriptable configuration allows for better container management.
    Eureka requires either external Configuration Server or multiple configuration files.

  • The options for securing communications is more advanced.
    Eureka requires creating application with security settings desired. Default will allow HTTP only. Registration of end points assumes http but can be forced to https with code.

@bxb100
bxb100 / useUndo.ts
Created February 17, 2024 14:00 — forked from KristofferEriksson/useUndo.ts
A React hook that enhances your components with powerful undo/redo functionality
import { useCallback, useEffect, useRef, useState } from "react";
interface UseUndoHook<T> {
value: T;
onChange: (newValue: T) => void;
undo: () => void;
redo: () => void;
clear: () => void;
canUndo: boolean;
canRedo: boolean;
@bxb100
bxb100 / system.md
Created July 1, 2023 02:50
操作系统
@bxb100
bxb100 / ca.md
Created June 24, 2023 13:16 — forked from soarez/ca.md
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

复制以下代码放到控制台即可

  • 去除 tracker 中 id 的部分
const cUrl = window.location.href;
const tracker = 'www.pttime.org';

const doEdit = async function (t) {
 if (!t.tracker.includes(tracker)) {
@bxb100
bxb100 / ExplorerFileNestingTrie.ts
Last active May 27, 2023 02:12
This copy from VSCode
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
type FilenameAttributes = {
// index.test in index.test.json
basename: string;
// json in index.test.json
extname: string;