Skip to content

Instantly share code, notes, and snippets.

View temberature's full-sized avatar

Tong temberature

  • USA
View GitHub Profile
@temberature
temberature / chat.mjs
Created February 2, 2023 05:48
chatgpt 迭代总结
import { ChatGPTAPIBrowser } from 'chatgpt'
import fs from 'fs'
import { readdir } from 'node:fs/promises';
const directoryPath = "./text";
async function example() {
// use puppeteer to bypass cloudflare (headful because of captchas)
192.168.1.102 gitlab.synology.com
192.168.1.8 nuc.com
@temberature
temberature / index.html
Last active August 24, 2022 23:07
rga client
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP -->
<meta http-equiv="Content-Security-Policy"
content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'">
<link href="./styles.css" rel="stylesheet">
<title>Hello World!</title>
var i = getPageNumWords();
for (var p = 0; p < i; p++) {
var word = getPageNthWord(0, p, false);
console.println(word);
if (word == "通" && getPageNthWord(0, p - 1, false) == "沟") {
var annot = this.addAnnot({
page: 0,
type: "Highlight",
author: "A. C. Robat",
point: [300, 400],
import { PDFDocument, StandardFonts, rgb } from "pdf-lib";
import fs from "fs";
import fontkit from "@pdf-lib/fontkit";
// Create a new PDFDocument
const pdfDoc = await PDFDocument.create();
// var font = fontkit.openSync('fonts/msyh.ttf');
const fontData = fs.readFileSync("fonts/msyh.ttf");
pdfDoc.registerFontkit(fontkit);
(function () {
const ea = window.ExcalidrawAutomate;
ea.onDropHook = async function (data) {
console.log(data);
if (
data.payload.text &&
data.payload.text.substring(0, 11) == "obsidian://"
) {
ea.reset();
@temberature
temberature / burner.sh
Created November 5, 2019 08:06
move file one by one
#!/usr/bin/env bash
## This is the target path, the directory
## you want to copy to.
target=$2;
## Find all files and folders in the current directory, sort
## them reverse alphabetically and iterate through them
find $1 -maxdepth 1 -type f | sort -r | while IFS= read -r file; do
## Set the counter back to 0 for each file
counter=0;
version: "2.1"
networks:
internal_network:
services:
db:
restart: always
networks:
- internal_network
build: ./MongoDB/
environment:
import System;
import System.Windows.Forms;
import Fiddler;
// INTRODUCTION
//
// Well, hello there!
//
// Don't be scared! :-)
//