Skip to content

Instantly share code, notes, and snippets.

View reorx's full-sized avatar
YOLO

Xiao Meng reorx

YOLO
View GitHub Profile
@noobnooc
noobnooc / cloudflare-worker-proxy.js
Last active May 1, 2024 15:04
cloudflare-worker-proxy
// Website you intended to retrieve for users.
const upstream = 'api.openai.com'
// Custom pathname for the upstream website.
const upstream_path = '/'
// Website you intended to retrieve for users using mobile devices.
const upstream_mobile = upstream
// Countries and regions where you wish to suspend your service.
@nanxiaobei
nanxiaobei / useDarkMode.ts
Last active July 14, 2022 08:56
returns isDark state, and a switch function for dark mode button
const useDarkMode = (): [boolean, () => void] => {
const [isDark, setIsDark] = useState(false);
const setDark = (newDark: boolean) => {
document.documentElement.classList[newDark ? 'add' : 'remove']('dark');
localStorage.setItem('dark', `${newDark}`);
setIsDark(newDark);
};
useEffect(() => {
@kepano
kepano / obsidian-web-clipper.js
Last active May 7, 2024 17:33
Obsidian Web Clipper Bookmarklet to save articles and pages from the web (for Safari, Chrome, Firefox, and mobile browsers)
javascript: Promise.all([import('https://unpkg.com/turndown@6.0.0?module'), import('https://unpkg.com/@tehshrike/readability@0.2.0'), ]).then(async ([{
default: Turndown
}, {
default: Readability
}]) => {
/* Optional vault name */
const vault = "";
/* Optional folder name such as "Clippings/" */
@0xabad1dea
0xabad1dea / copilot-risk-assessment.md
Last active September 11, 2023 10:21
Risk Assessment of GitHub Copilot

Risk Assessment of GitHub Copilot

0xabad1dea, July 2021

this is a rough draft and may be updated with more examples

GitHub was kind enough to grant me swift access to the Copilot test phase despite me @'ing them several hundred times about ICE. I would like to examine it not in terms of productivity, but security. How risky is it to allow an AI to write some or all of your code?

Ultimately, a human being must take responsibility for every line of code that is committed. AI should not be used for "responsibility washing." However, Copilot is a tool, and workers need their tools to be reliable. A carpenter doesn't have to

@TaylanTatli
TaylanTatli / Custom CSS.css
Last active April 10, 2024 01:35
I created a repo for Miniflux Themes and added a new Catppuccin theme. If anyone interested: https://github.com/TaylanTatli/MinifluxThemes
:root {
--font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
--body-color: rgba(255, 255, 255, 0.7);
--body-background: #282c34;
--header-link-color: #9b9494;
--header-active-link-color: #d19a66;
--input-border: 1px solid #2c384e;
--input-background: #2c384e;
--input-placeholder-color: #888;
--input-focus-border-color: #d19a66;

之前一直是全空格写法,即中文与所有非中文之间全部加上空格,但近来感觉到这种写法在有些情况下既低效又不美观,因此想把不同情况列出,对比增加空格与否的优劣得失。

请注意,本文仅为个人看法,旨在探讨不同书写方式的可能性,不对其他规范进行赞成或反对。

以下书写元素将被涉及:

  • 中文字
  • 中文标点
  • 英文字母(代表所有拉丁字母)
  • 半角标点
  • 数字
# Read more about setting it up
# https://medium.com/@ljmocic/deploying-react-application-to-aws-s3-using-github-actions-85addacaeace
on:
push:
tags:
- '*'
jobs:
build:
@bp2008
bp2008 / HyperVServer2019_GUI_Installation.md
Last active January 30, 2024 22:01
How to install a graphical desktop environment on Hyper-V Server 2019

Hyper-V Server 2019 GUI Installation Guide

Introduction

Hyper-V Server does not include much in the way of graphical tools, but third-party alternatives can be installed.

I found a disturbing lack of basic instructions for using Hyper-V Server 2019, so it is my hope that this guide is useful to somebody.

Before starting this guide, enable Remote Desktop support in Hyper-V Server using the built-in configuration menu. If you connect to the Hyper-V Server with Remote Desktop, it will make it easy to copy and paste text (and later, files) from a normal Windows desktop machine.

@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active May 7, 2024 09:32
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized

Docker Hub 镜像加速器

国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。Docker 官方和国内很多云服务商都提供了国内加速器服务。

Dockerized 实践 https://github.com/y0ngb1n/dockerized

配置加速地址

Ubuntu 16.04+、Debian 8+、CentOS 7+

ShadowsocksR 协议插件文档


概要

用于方便地产生各种协议接口。实现为在原来的协议外套一层编码和解码接口,不但可以伪装成其它协议流量,还可以把原协议转换为其它协议进行兼容或完善(但目前接口功能还没有写完,目前还在测试完善中),需要服务端与客户端配置相同的协议插件。插件共分为两类,包括混淆插件和协议定义插件。

现有插件介绍

1.混淆插件