Skip to content

Instantly share code, notes, and snippets.

View WooodHead's full-sized avatar

WooodHead

  • Hangzhou
View GitHub Profile
@JimLiu
JimLiu / ChatGPT-Translate-Long-Text.js
Last active April 8, 2024 07:26
使用ChatGPT自动分页翻译长文
// WARNING:此脚本仅做学习和演示用途,在不了解其用途前不建议使用
// 本脚本的用途是将输入内容分页,每次提取一页内容,编辑第二条消息,发送,然后收集结果
// 使用前,需要有两条消息,参考模板 https://chat.openai.com/share/17195108-30c2-4c62-8d59-980ca645f111
// 演示视频: https://www.bilibili.com/video/BV1tp4y1c7ME/?vd_source=e71f65cbc40a72fce570b20ffcb28b22
//
(function (fullText) {
const wait = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
const groupSentences = (fullText, maxCharecters = 2800) => {
const sentences = fullText.split("\n").filter((line) => line.trim().length > 0);
export const chaosTestStrings = (): void => {
const textNodes = getAllTextNodes(document.body);
for (const node of textNodes) {
const textNodeLength = node.textContent ? node.textContent.length : 0;
if (node.textContent === null) {
return;
}
if (node.parentElement instanceof Element) {
if (node.parentElement.dataset.originalText === undefined) {
@saerdnaer
saerdnaer / yt2text.py
Last active May 29, 2021 08:09
download german transcript from youtube and convert to better readable text
'''
Downloads YouTube subtitles to human readable text, while fixing casing of german words.
Example usage:
python3 yt2text.py _RlwgfYd65Q > ultraschall5.txt
'''
import argparse
from youtube_transcript_api import YouTubeTranscriptApi
@ruralocity
ruralocity / starship.toml
Created September 28, 2020 15:15
My current Starship.rs configuration file
# Don't print a new line at the start of the prompt
add_newline = false
# Disables the line_break module, making the prompt a single line.
[line_break]
disabled = true
# Replace the "❯" symbol in the prompt
[character]
symbol = "$"
@glowinthedark
glowinthedark / generate_directory_index_caddystyle.py
Last active February 16, 2024 21:58
Generate directory index (recurse subfolders with `-r` or `--recursive`). Use `-h` or `--help` for all options ❗️superseded by https://github.com/glowinthedark/index-html-generator
#!/usr/bin/env python3
# NOTE: this script is deprecated;
# maintained version with SVG icons: https://github.com/glowinthedark/index-html-generator/
# ---
# Copyright 2020 glowinthedark
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@darwinsubramaniam
darwinsubramaniam / forRootAndForFeature.md
Last active January 31, 2024 08:37
The Explaination of forRoot and ForFeature

ForRoot

This is useful when the registerAs is required across, so it is best to use it in the AppModule

import databaseConfig from './config/database.config';
@Module({
  imports: [
    ConfigModule.forRoot({
      load: [databaseConfig],
 }),
@gmolveau
gmolveau / parallel.sh
Created July 2, 2020 21:04
todo parallel commands
cat urls.txt | xargs youtube-mp4 {}
cat urls.txt | xargs zsh -c 'youtube-mp4 {}'
cat urls.txt | xargs $functions[youtube-mp4] {}
cat urls.txt | xargs zsh -c '$functions[youtube-mp4] {}'
cat urls.txt | parallel curl http://example.com/item/{}.tar ">" {}.tar
@anton-dudarev
anton-dudarev / settings.jsonc
Last active October 9, 2020 04:36
Microsoft Terminal Settings
// This file was initially generated by Windows Terminal 0.11.1191.0
// It should still be usable in newer versions, but newer versions might have additional
// settings, help text, or changes that you will not see unless you clear this file
// and let us generate a new one for you.
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
@TomonoriSoejima
TomonoriSoejima / bool_query.md
Last active November 2, 2021 16:13
role test.md
POST /_security/role/access_role_1
{
    "indices" : [
      {
        "names" : [
          "test"
        ],
        "privileges" : [
 "read"
@hadynz
hadynz / serverless-deploy.yml
Created May 26, 2020 09:44
Serverless deploy with state management in S3
name: Continuous deploy
on:
push:
branches: [master]
jobs:
serverless-deploy:
runs-on: ubuntu-latest