Skip to content

Instantly share code, notes, and snippets.

View lidaobing's full-sized avatar
🦍
Mammal - verified by Github

LI Daobing lidaobing

🦍
Mammal - verified by Github
View GitHub Profile
@lidaobing
lidaobing / main.go
Created April 1, 2023 09:30
chatgpt proxy with gitlab auth method
package main
import (
"log"
"net/http"
"net/http/httputil"
"os"
"strings"
)
// 部署流程请参考: https://github.com/bestony/ChatGPT-Feishu
// @see https://docs.aircode.io/guide/functions/
const aircode = require('aircode');
const lark = require('@larksuiteoapi/node-sdk');
const EventDB = aircode.db.table('event');
const { Configuration, OpenAIApi } = require("openai");
const configuration = new Configuration({
apiKey: process.env.OPENAI_API_KEY,
});
const openai = new OpenAIApi(configuration);
if [ `uname` = 'Darwin' ]; then
if [ `arch` = 'arm64' ]; then
export PATH="/opt/homebrew/sbin:/opt/homebrew/bin:/usr/local/bin:$PATH"
PS1_ARCH="[ARM]"
else
export PATH="/usr/local/sbin:/usr/local/bin:/opt/homebrew/bin:$PATH"
PS1_ARCH="[X86]"
fi
export PS1="$PS1_ARCH$PS1"
alias ibrew="arch -x86_64 /usr/local/bin/brew"
#include <iostream>
#include <sigc++/signal.h>
using namespace std;
class A {
public:
sigc::signal<void()> s1;
};
// Result:
// signal does not depends on main loop
// GSimpleAction is a very useful tool for DocView model
#include <gio/gio.h>
namespace {
bool c1 = false;
bool c2 = false;
void callback1() {
diff --git a/wrapper/ibus/setup/main.py b/wrapper/ibus/setup/main.py
index e20a3a5..396c514 100644
--- a/wrapper/ibus/setup/main.py
+++ b/wrapper/ibus/setup/main.py
@@ -39,10 +39,12 @@ import os
from os import path
try:
import gtk
+ import glib
except ImportError:
#!/usr/bin/env /usr/local/bin/python3
import netrc
import requests
import json
class Task:
def __init__(self, number, title, url, assignee):
self.number = number
self.title = title
sequenceDiagram
    participant Alice
    participant Bob
    Alice->John: Hello John, how are you?
    loop Healthcheck
        John->John: Fight against hypochondria
    end
    Note right of John: Rational thoughts <br/>prevail...
 John--&gt;Alice: Great!
#coding=utf-8
import json, os, sys, uuid, datetime, subprocess, traceback
def runCmd(cmd):
return [str(x) for x in subprocess.check_output(cmd, shell=True).splitlines()]
def getServerId():
try:
#coding=utf-8
import http.server
import socketserver
import datetime
import uuid
from urllib.parse import urlparse, parse_qs
__all__ = ['run']