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-->Alice: Great!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"log" | |
"net/http" | |
"net/http/httputil" | |
"os" | |
"strings" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 部署流程请参考: 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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <sigc++/signal.h> | |
using namespace std; | |
class A { | |
public: | |
sigc::signal<void()> s1; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#coding=utf-8 | |
import http.server | |
import socketserver | |
import datetime | |
import uuid | |
from urllib.parse import urlparse, parse_qs | |
__all__ = ['run'] |
NewerOlder