Skip to content

Instantly share code, notes, and snippets.

View bowencool's full-sized avatar
🏢
Looking for a job

Bowen bowencool

🏢
Looking for a job
View GitHub Profile
@bowencool
bowencool / icons.json
Last active July 16, 2024 02:51 — forked from fwqaaq/icons.json
vscode-material-icon-theme
{"fileIcons":{"defaultIcon":{"name":"file"},"icons":[{"name":"html","fileExtensions":["htm","html","xhtml","html_vm","asp"]},{"name":"pug","fileExtensions":["jade","pug"],"fileNames":[".pug-lintrc",".pug-lintrc.js",".pug-lintrc.json"]},{"name":"markdown","fileExtensions":["md","markdown","rst"]},{"name":"blink","fileExtensions":["blink"],"light":true},{"name":"css","fileExtensions":["css"]},{"name":"sass","fileExtensions":["scss","sass"]},{"name":"less","fileExtensions":["less"]},{"name":"json","fileExtensions":["json","jsonc","tsbuildinfo","json5","jsonl","ndjson"],"fileNames":[".jscsrc",".jshintrc","composer.lock",".jsbeautifyrc",".esformatter","cdp.pid",".lintstagedrc"]},{"name":"jinja","fileExtensions":["jinja","jinja2","j2","jinja-html"],"light":true},{"name":"proto","fileExtensions":["proto"]},{"name":"playwright","fileNames":["playwright.config.js","playwright.config.mjs","playwright.config.ts","playwright.config.base.js","playwright.config.base.mjs","playwright.config.base.ts","playwright-ct.config.js
@bowencool
bowencool / component.tsx
Last active April 11, 2024 06:30
Create shadcn Dialog
import React, { useEffect, useRef, useState } from "react";
import type { ReactNode } from "react";
import { DialogProps } from "@radix-ui/react-dialog";
import { Dialog } from "@/components/ui/dialog";
import { FieldValues, UseFormProps, UseFormReturn, useForm } from "react-hook-form";
import { z } from "zod";
import { zodResolver } from "@hookform/resolvers/zod";
export type CreateDialogProps<T extends FieldValues, R = undefined> = Omit<DialogProps, "open"> & {
/**
@bowencool
bowencool / certbot-renew-hook.ts
Created August 19, 2023 15:34
阿里云 aliyun certbot-renew-hook
import { DescribeDomainRecordsRequest, DescribeDomainRecordsResponseBodyDomainRecordsRecord, UpdateDomainRecordRequest } from '@alicloud/alidns20150109';
import client from './client'
const { CERTBOT_VALIDATION, CERTBOT_REMAINING_CHALLENGES, CERTBOT_DOMAIN, CERTBOT_ALL_DOMAINS } = process.env
console.log({ CERTBOT_VALIDATION, CERTBOT_REMAINING_CHALLENGES, CERTBOT_DOMAIN })
async function getConfiguredTXTRecord() {
const describeDomainRecordsRequest = new DescribeDomainRecordsRequest({});
describeDomainRecordsRequest.domainName = CERTBOT_DOMAIN;
describeDomainRecordsRequest.type = "TXT";
@bowencool
bowencool / dida365.oauth.js
Last active January 23, 2024 13:32
dida365 oauth 滴答清单
// https://blog.bowen.cool/posts/how-to-forward-sms-to-your-todo-list
const Koa = require("koa");
const Router = require("@koa/router");
const { PORT = 4001 } = process.env;
const client_id = "xxx";
const client_secret = "xxx";
const scope = "tasks:write";
const redirect_uri = `http://localhost:${PORT}/redirect`;