Skip to content

Instantly share code, notes, and snippets.

View jiahut's full-sized avatar
🎯
Focusing

zhijia,.zhang jiahut

🎯
Focusing
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);
@Shaunwei
Shaunwei / main.py
Last active July 10, 2023 15:02
Microsoft Guidance OpenAI function calling template
from openai_function_call import openai_function
import guidance
@openai_function
def get_weather(location: str, unit: str = 'fahrenheit', date: str = 'today'):
""" Get the current weather in a given location and date."""
weather_info = {
'location': location,
'unit': unit,
'temperature': '60' if unit == 'fahrenheit' else '15',
@gpchelkin
gpchelkin / shadowsocks-rust-server.sh
Last active March 13, 2024 14:55
How to Setup shadowsocks-rust Server with xray-plugin (or v2ray-plugin) on Any Linux Host
#!/usr/bin/env bash
# https://github.com/shadowsocks/shadowsocks-rust/releases
export SSVERSION=v1.18.2
export SSPORT=143
export SSPASSWORD="CHANGEME"
export SSARCHIVE="shadowsocks-${SSVERSION}.x86_64-unknown-linux-gnu.tar.xz"
#export SSARCHIVE="shadowsocks-${SSVERSION}.aarch64-unknown-linux-gnu.tar.xz"
export PREFIX=/usr/local/bin
@jserpapinto
jserpapinto / i3config
Last active May 30, 2021 16:34
Manjaro - i3 config (~/.i3/config)
# Changes:
# * bind 9 key to 9 workspace
# * prntscrn copy to clipboard
# * use py3status
# * move window across monitors
#
# i3 config file (v4)
# Please see http://i3wm.org/docs/userguide.html for a complete reference!
# Set mod key (Mod1=<Alt>, Mod4=<Super>)
@cryptoquick
cryptoquick / fish_bind_enter.fish
Created November 28, 2019 17:19
bind enter key to repeat last command in fish shell
function bind_enter
set -l lastline $history[1]
set -l cmdline (commandline)
if test -z (string trim "$cmdline")
commandline -r $lastline
commandline -f execute
else
commandline -f execute
end
end
@ranma2913
ranma2913 / pipeline.gdsl
Last active September 11, 2023 05:33 — forked from ggarcia24/pipeline.gdsl
GDSL supporting pipeline declarative
//The global script scope
def ctx = context(scope: scriptScope())
//What things can be on the script scope
contributor(ctx) {
method(name: 'pipeline', type: 'Object', params: [body: Closure])
method(name: 'build', type: 'Object', params: [job: 'java.lang.String'], doc: 'Build a job')
method(name: 'build', type: 'Object', namedParams: [parameter(name: 'job', type: 'java.lang.String'), parameter(name: 'parameters', type: 'Map'), parameter(name: 'propagate', type: 'boolean'), parameter(name: 'quietPeriod', type: 'java.lang.Integer'), parameter(name: 'wait', type: 'boolean'),], doc: 'Build a job')
method(name: 'echo', type: 'Object', params: [message: 'java.lang.String'], doc: 'Print Message')
method(name: 'emailextrecipients', type: 'Object', params: [recipientProviders: 'Map'], doc: 'Extended Email Recipients')
@ryanmaclean
ryanmaclean / .zshrc
Created January 22, 2019 16:13
Zsh Profile
# -*- mode: sh -*-
# Loaded by every zsh shell
# Do not put environement variables in it, use
# .profile for it.
if [ "$TMUX" = "" ]; then tmux; fi
# * zplug
export ZPLUG_HOME=${HOME}/.zplug
if [[ ! -d ${ZPLUG_HOME} ]]; then
git clone https://github.com/zplug/zplug $ZPLUG_HOME
~/.w3m/keymap
keymap C-o NEXT_PAGE
default keymaps https://github.com/tokuhirom/w3m/blob/master/doc-jp/keymap.default
functions https://github.com/tats/w3m/blob/master/doc/README.func
Usefull functions:
SUBMIT - to submit the form (bind to C-o)
@rise-worlds
rise-worlds / For Mac 4.2.6 unlimited trial.md
Last active April 18, 2024 16:35 — forked from satish-setty/trial.md
Beyond Compare 4 license for Windows, Mac, Linux

for 4.2.4 or higher, 4.2.5,4.2.6,4.3.7, it's works, this is the way which makes Always in evaluation mode.

  1. open Terminal, go to the dir : cd /Applications/Beyond Compare.app/Contents/MacOS
  2. change the name BCompare to BCompare.bak: mv BCompare BCompare.bak
  3. touch a file name BCompare , and chmod a+ux BCompare : touch BCompare && chmod a+ux BCompare
  4. open BCompare with text editor, insert the script :
#!/bin/bash
rm "/Users/$(whoami)/Library/Application Support/Beyond Compare/registry.dat"
"`dirname "$0"`"/BCompare.bak $@
// Unmap undesired defaults
const unmaps = [
"sb", "sw", "ob",
"ow", "cp", ";cp",
";ap", "spa", "spb",
"spd", "sps", "spc",
"spi", "sfr", "zQ",
"zz", "zR", "ab",
"Q", "q", "ag",
"af", ";s", "yp",