Skip to content

Instantly share code, notes, and snippets.

View PegasisForever's full-sized avatar
🍳
Cooking

Jianqing Liu PegasisForever

🍳
Cooking
View GitHub Profile
@PegasisForever
PegasisForever / peimon-tos.md
Created February 13, 2026 02:39
Peimon Discord Bot ToS

TERMS OF SERVICE AGREEMENT

This Terms of Service Agreement (the "Agreement") is entered into between Jianqing Liu ("Bot Owner") and the user ("User") of the Peimon Discord bot (the "Bot").

By using the Bot, the User agrees to be bound by the terms of this Agreement. If the User does not agree to the terms of this Agreement, they should immediately discontinue use of the Bot.

  1. Use of the Bot: The Bot Owner grants the User a non-exclusive, non-transferable, limited license to use the Bot for personal or non-commercial purposes.
  2. Prohibited Use: The User may not use the Bot in any way that violates applicable laws, rules, or regulations or infringes upon the rights of any third party. The User may not use the Bot for any commercial purposes without the express written consent of the Bot Owner.
  3. Limitation of Liability: The Bot Owner shall not be liable for any damages arising out of the use or inability to use the Bot, including but not limited to, damages for loss of profits, loss of data, or other int
@PegasisForever
PegasisForever / peimon-privacy-policy.md
Last active February 13, 2026 02:37
Peimon Discord Bot Privacy Policy

Privacy Policy for Peimon

This Privacy Policy governs the collection, use, and sharing of personal information by Peimon, a Discord bot developed by @pegasis0. By using Peimon, you agree to the terms of this Privacy Policy.

Information We Collect

We collect information that you provide to us through your use of the bot, such as your Discord user ID and username, server and channel information, and message content. We may also collect usage data, such as the frequency and duration of your use of the bot.

How We Use Your Information

function averageColor(a, b) {
let ar = parseInt(a.substr(0, 2), 16)
ar *= ar
let ag = parseInt(a.substr(2, 2), 16)
ag *= ag
let ab = parseInt(a.substr(4, 2), 16)
ab *= ab
let br = parseInt(b.substr(0, 2), 16)
br *= br
let bg = parseInt(b.substr(2, 2), 16)
#[macro_use]
extern crate log;
use rand::Rng;
use rand::prelude::ThreadRng;
use serde::Serialize;
use std::env;
use std::thread;
use std::time::SystemTime;
use reqwest::blocking::Client;
.tostr : To string
ANY → str($expr$)
@PegasisForever
PegasisForever / nextcloud-uploader.py
Last active July 25, 2023 22:08
upload files to nextcloud and get shareable link
#!/usr/bin/python3
import sys
import os
import requests
import time
from requests.auth import HTTPBasicAuth
import xml.etree.ElementTree as ET
@PegasisForever
PegasisForever / gist:d44c8f1c2a709a184cf5cd0988cde3f2
Created April 18, 2020 15:35
set default group and group permission
sudo find . -type d -exec chgrp webmanager {} +
sudo find . -type d -exec chmod g+s {} +
sudo find . -type d -exec setfacl -m default:group::rwx {} +
import java.util.*
class TreeNode(var `val`: Int) {
var left: TreeNode? = null
var right: TreeNode? = null
}
typealias LeetNode = TreeNode
fun LeetNode.toNode(): Node<Int> {
return Node(`val`).apply {
@PegasisForever
PegasisForever / Main.java
Last active January 14, 2020 03:42
An example of graph in java
import java.util.ArrayList;
//Definition of Node
class Node {
String name; // Name of the node
ArrayList<Node> connectedNodes = new ArrayList<>(); // All nodes connected to this node
// Constructor, called when use `new Node("name")`
Node(String n) {
name = n;
@PegasisForever
PegasisForever / add_srt.sh
Created December 24, 2019 07:12
a script that renders srt file to a mp4 file using ffmpeg
ffmpeg -i input.mp4 -filter:v subtitles=subtitle.srt -c:a copy -c:v libx264 -crf 22 -preset veryfast output.mp4