Skip to content

Instantly share code, notes, and snippets.

View doitian's full-sized avatar
🎯
Focusing

ian doitian

🎯
Focusing
View GitHub Profile
@doitian
doitian / registries.conf
Last active April 28, 2024 14:00
[Configure Docker Hub mirror in /etc/containers/registries.conf] #docker #podman #proxy
unqualified-search-registries = ['docker.io']
[[registry]]
prefix = "docker.io"
location = "docker.io"
[[registry.mirror]]
prefix = "docker.io"
# This will set the docker registry mirror of a chinese university.
# DON'T use it unless you have a network connection issue and you trust the mirror provider.
@doitian
doitian / evernote_markdown.js
Last active February 26, 2024 09:59
[Paste Markdown as Code Block in Evernote] #macOS #automation #evernote
function escapeHtml(unsafe) {
return unsafe
.replace(/&/g, "&")
.replace(/</g, "&lt;")
.replace(/>/g, "&gt;")
.replace(/"/g, "&quot;")
.replace(/'/g, "&#039;")
.replace(/\t/g, " ")
.replace(/ /g, "&nbsp; ")
.replace(/ /g, " &nbsp;")
This file has been truncated, but you can view the full file.
"use strict";
var obsidian = require("obsidian");
/******************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
#!/bin/bash
# Start Python REPL and setup rich
# https://rich.readthedocs.io/en/latest/introduction.html#rich-in-the-repl
""":"
PYTHON=${PYTHON:-python}
if command -v python3 &>/dev/null; then
PYTHON=python3
fi
import base64
from Crypto.Hash import SHA256
from Crypto.PublicKey import ECC
from Crypto.Signature import DSS
from Crypto.Util.asn1 import DerSequence
response = {
"signature": "MEUCICF25qdO6nLreEoBHnyaw-9R6XFHbIu-NwsAI53t016qAiEAgmhlwTEMxoWx"
"Kj79R1rUkB_6nrhJfws82DqHkY_HnqQ",
{
"openrpc": "1.0.0-rc1",
"info": {
"version": "1.0.0",
"title": "Petstore",
"license": {
"name": "MIT"
}
},
"servers": [
@doitian
doitian / settings.json
Created September 1, 2023 02:38
vscode settings
{
"[javascript]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
},
"[json]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
@doitian
doitian / input.js
Last active August 11, 2023 03:31
Obisidian CustomJS module to ask for user input
class Input {
PromptModal = class extends customJS.obsidian.Modal {
title = "Input";
value = "";
submitted = false;
placeholder = "Type text here";
constructor(opts = {}) {
super(app);
Object.assign(this, opts);
@doitian
doitian / config.yml
Last active August 10, 2023 12:57
Open history version files from Git in Vim via LazyGit
# yaml-language-server: $schema=https://json.schemastore.org/lazygit.json
promptToReturnFromSubprocess: false
os:
editPreset: "nvim"
customCommands:
- key: E
context: commitFiles
subprocess: true
# - When a file is selected, open the file before the commit
@doitian
doitian / transmission-docker-compose.yaml
Last active June 23, 2023 10:22
[Transmission Docker Compose] #docker #qnap #nas
---
version: "2.1"
services:
transmission:
image: linuxserver/transmission
container_name: transmission
environment:
- PUID=1000
- PGID=0
- TZ=Asia/Shanghai