Skip to content

Instantly share code, notes, and snippets.

View Quorafind's full-sized avatar
🎯
Focusing

Boninall Quorafind

🎯
Focusing
View GitHub Profile
@Quorafind
Quorafind / calendar.tsx
Created December 13, 2023 08:34 — forked from mjbalcueva/calendar.tsx
shadcn ui calendar custom year and month dropdown
"use client"
import * as React from "react"
import { buttonVariants } from "@/components/ui/button"
import { ScrollArea } from "@/components/ui/scroll-area"
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"
import { cn } from "@/lib/utils"
import { ChevronLeft, ChevronRight } from "lucide-react"
import { DayPicker, DropdownProps } from "react-day-picker"
@Quorafind
Quorafind / CopyChatGPT.js
Created February 23, 2023 04:31
Use Quickadd to copy ChatGPT result
module.exports = {"Copy Chat History": copyChatWithHistory, "Copy Last Answer": copyLastAnswer};
const ExportMD = (function () {
if (!window.TurndownService) return;
const hljsREG = /^.*(hljs).*(language-[a-z0-9]+).*$/i;
const turndownService = new window.TurndownService({
headingStyle: "atx",
hr: "---",
bulletListMarker: "-",
codeBlockStyle: "fenced",
@Quorafind
Quorafind / AskChatGPT-With-Surfing.js
Created February 19, 2023 11:20
Using Quickadd to ask current selection In ChatGPT
// Version 0.0.1
module.exports = askChatWithPrompt;
function askChat(str, app) {
const prompt = encodeURI(str);
const chatViewEl = app.workspace.getLeavesOfType("surfing-view").find((item)=>{ return /chat\.openai\.com/.test(item?.view?.currentUrl)}).view.webviewEl;
chatViewEl.executeJavaScript(`
var htmlElement = document.querySelector("textarea");
htmlElement.value = decodeURI("${ prompt }");
@Quorafind
Quorafind / Dynamic Highlight.data.md
Last active February 20, 2023 01:57
Using dynamic highlight to highlight HH:mm/H:mm time format in Obsidian

Import data json below to dynamic highlight config.

{
  "light-time-8-5": {
    "class": "light-time-8-5",
    "color": "#E45858",
    "regex": true,
    "query": "(?<=\\s)(0?8|20):[3-5][0-9](:[0-5][0-9])?(?=(\\s|$))",
    "mark": [
@Quorafind
Quorafind / index.ts
Last active January 7, 2023 13:24
Obsidian Plugin Register Keymap for LeafView
export default class mapForNotePlugin extends Plugin {
//...
public activeMapForNoteView: MapForNote = null;
async onload(): Promise<void> {
//...
this.registerEventListeners();
}
//...
@Quorafind
Quorafind / loadModelAndCheck.py
Last active July 20, 2019 02:40
加载.pb文件并检测
import tensorflow as tf
import numpy as np
from PIL import Image
FILEPATH = path_to_img # 检测文件地址
MODELPATH = path_to_pb_file # pb文件
SIZE = [100, 100] # 检测图片规格
DIC = {0: 'aaa', 1: 'bbb'} # 定义字典,保存标签和类别的映射关系
# 图片转化为数组
@Quorafind
Quorafind / loadModel.py
Last active July 20, 2019 02:35
加载.pb文件
def load_pb(path_to_pb):
with tf.gfile.GFile(path_to_pb, "rb") as f:
graph_def = tf.GraphDef()
graph_def.ParseFromString(f.read())
with tf.Graph().as_default() as graph:
tf.import_graph_def(graph_def, name='')
return graph
#你可以检索感兴趣的张量
input = graph.get_tensor_by_name('input:0')