Skip to content

Instantly share code, notes, and snippets.

View bxb100's full-sized avatar
🥲
R.I.P, My friend

Lemon bxb100

🥲
R.I.P, My friend
View GitHub Profile
@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;
@bxb100
bxb100 / private_fork.md
Created April 24, 2023 16:50 — forked from 0xjac/private_fork.md
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare git@github.com:usi-systems/easytrace.git

@bxb100
bxb100 / gist:3477f298a3496efb5c8054ca7b03e531
Created April 23, 2023 14:55 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue: