Skip to content

Instantly share code, notes, and snippets.

View discountry's full-sized avatar
📕
Learning

Disney discountry

📕
Learning
View GitHub Profile
[Unit]
Description=gunicorn daemon
Requires=gunicorn.socket
After=network.target
[Service]
Type=notify
# the specific user that our service will run as
User=dev
Group=dev
payload:
- '+.aadrm.com'
- '+.acompli.com'
- '+.acompli.net'
- '+.aka.ms'
- '+.akadns.net'
- '+.aspnetcdn.com'
- '+.assets-yammer.com'
- '+.azure.com'
- '+.azure.net'
import ccxt
import talib
import time
# Initialize Binance client
exchange = ccxt.binance({
"apiKey": "YOUR_API_KEY",
"secret": "YOUR_SECRET_KEY",
"enableRateLimit": True,
})
const OPENAI_URL = 'https://api.openai.com';
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
})
async function handleRequest(request) {
const url = new URL(request.url);
url.host = OPENAI_URL.replace(/^https?:\/\//, '');
const modifiedRequest = new Request(url.toString(), {
@discountry
discountry / larkGPT.js
Created March 2, 2023 03:59
chatgpt bot for Lark
// @version 0.1.0 最新官方 chatgpt API
const aircode = require("aircode");
const lark = require("@larksuiteoapi/node-sdk");
var axios = require("axios");
const EventDB = aircode.db.table("event");
const ConversationDB = aircode.db.table("conversation");
// 如果你不想配置环境变量,或环境变量不生效,则可以把结果填写在每一行最后的 "" 内部
const FEISHU_APP_ID = process.env.APPID || ""; // 飞书的应用 ID
const FEISHU_APP_SECRET = process.env.SECRET || ""; // 飞书的应用的 Secret
git log --format='%aN' | sort -u | while read name; do echo -en "作者: $name\t"; git log --author="$name" --pretty=tformat: --numstat | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "添加行数: %s, 删除的行数: %s, 代码总行数: %s\n", add, subs, loc }' -; done
import sites/*
import snippets/*
import laravel-app laravel.com /var/www/laravel
[Unit]
Description=Run chatGPT binary
Wants=network.target
After=network.target
[Service]
Type=simple
DynamicUser=yes
WorkingDirectory=/var/www/chatGPT
Environment=XDG_CONFIG_HOME="/path-to/.config"
@discountry
discountry / Chart.tsx
Created September 20, 2022 13:30
nextjs dynamic import custom ref
import { FC, useImperativeHandle } from "react";
type ChartProps = {
chartRef?: any;
};
const Chart: FC<ChartProps> = ({ chartRef }) => {
useImperativeHandle(chartRef, () => ({
test() {
alert("test");