Skip to content

Instantly share code, notes, and snippets.

View theowenyoung's full-sized avatar

Owen theowenyoung

View GitHub Profile
theowenyoung / example.js
Last active March 11, 2023 11:44
curl to json, convert curl to json, convert curl to fetch options
const result = parseCurl(
"curl -X POST -H 'Content-Type: application/json' -d '{\"name\": \"John\"}' http://localhost:8000/tasks/2/run"
console.log("result", result);
assertEquals(result.method, "POST");
assertEquals(result.headers, {
"Content-Type": "application/json",
theowenyoung / update_stayfork.ts
Created February 19, 2023 04:55
Auto update stayfork userscript
async function uploadToStay() {
const userscriptContent = await Deno.readTextFile(
const STAYFORK_API_KEY = Deno.env.get("STAYFORK_API_KEY");
throw new Error("STAYFORK_API_KEY is not set");
const response = await fetch(
theowenyoung /
Last active February 14, 2023 13:12
Install Gost Service
# must use root
if [ "$(whoami)" != "root" ]; then
echo "must use root"
exit 1
echo start install $REPO_NAME latest v${latest_version}
cd /tmp
theowenyoung / User.js
Last active December 22, 2022 06:02
monkey test
// ==UserScript==
// @name Twitter Media Downloader
// @name:ja Twitter Media Downloader
// @name:zh-cn Twitter 媒体下载
// @name:zh-tw Twitter 媒體下載
// @description Save Video/Photo by One-Click.
// @description:ja ワンクリックで動画・画像を保存する。
// @description:zh-cn 一键保存视频/图片
// @description:zh-tw 一鍵保存視頻/圖片
// @version 1.05
theowenyoung / user.js
Created December 22, 2022 05:29
// ==UserScript==
// @name New Userscript
// @namespace
// @version 0.1
// @description try to take over the world!
// @author You
// @match *://*/*
// @icon
// @grant GM_getValue
// @grant GM_setValue
theowenyoung / check-uncommited-git-github-actions.yml
Created January 21, 2022 08:47
Github Actions workflow file, check if there are uncommited changes
name: Github Actions check if there are uncommited changes
- main
runs-on: ubuntu-latest
theowenyoung / file-browser-template-for-caddy.html
Last active September 13, 2021 05:14
Caddy file browser template with common player URL Scheme
<!DOCTYPE html>
<title>{{html .Name}}</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="" rel="stylesheet" integrity="sha384-KyZXEAg3QhqLMpG8r+8fhAXLRk2vvoC2f3B09zVXn8CA5QIVfZOJ3BCsw2P0p/We" crossorigin="anonymous">
* { padding: 0; margin: 0; }
body {
theowenyoung / redox.json
Last active June 2, 2021 10:35
redox keymap
"version": 1,
"notes": "",
"documentation": "\"This file is a QMK Configurator export. You can import this at <>. It can also be used directly with QMK's source code.\n\nTo setup your QMK environment check out the tutorial: <>\n\nYou can convert this file to a keymap.c using this command: `qmk json2c {keymap}`\n\nYou can compile this keymap using this command: `qmk compile {keymap}`\"\n",
"keyboard": "redox/rev1",
"keymap": "redox_rev1_layout_mine",
"layout": "LAYOUT",
"layers": [
theowenyoung / us-stock-code-zh.json
Created December 16, 2020 05:03
"SINA": "新浪",
"SOHU": "搜狐",
"NTES": "网易",
"BIDU": "百度",
"NCTY": "第九城市",
"JRJC": "金融界",
"JOBS": "前程无忧",
"UTSI": "UT斯达康",
"EDU": "新东方",
theowenyoung /
Created September 28, 2020 06:27
github action commit & push
git config github-actions[bot]
git config ithub-actions[bot]
git remote add origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}${{github.repository}}.git
git add .
git commit -m "chore: build"
git push