Skip to content

Instantly share code, notes, and snippets.

View ankanch's full-sized avatar

bounty Donator ankanch

  • AF -> DE
  • W: Hangzhou , H: Mianyang
  • 07:31 (UTC +08:00)
View GitHub Profile
@ankanch
ankanch / chatgpt-bot-4-feishu-web-external-group.js
Created June 15, 2023 03:10
适用于飞书外部群的ChatGPT 机器人 (基于飞书网页版)
/**
* 适用于飞书外部群的ChatGPT 机器人
* 对于飞书内部群,可以直接通过开发飞书机器人实现内部群的消息监听和回复。
* 但对于飞书外部群,无法添加内部机器人程序, 只能添加非常简单的基于Webhook 的机器人 (参考:https://open.feishu.cn/document/client-docs/bot-v3/add-custom-bot)
* 机器人无法直接获得外部群的消息。
*
* 本脚本实现,监听飞书网页版外部群消息(HTML元素变化),并将群消息发送给 ChatGPT 处理。
* 使用方法:
* 1. 打开飞书网页版
* 2. 等待网页版加载完成
@ankanch
ankanch / example.java
Created January 26, 2022 11:24
print jicofo stanza?
// step 1. writing a class like below:
import org.jivesoftware.smack.StanzaListener;
import org.jivesoftware.smack.packet.Presence;
import org.jivesoftware.smack.packet.Stanza;
public class PrintStanzaHandler implements StanzaListener {
@Override
@ankanch
ankanch / swap1062.py
Created March 30, 2018 06:46
USED FOR SHORT URL SERVICE - 10 base and 62 base number conversion
# USED FOR SHORT URL SERVICE
# 10 base number and 62 based number convertion
# used for 62 based code convert to primary key in database
# only number large than and equal to 0 works
#
# by Kanch -> kanch is me @ gmail . com
# http://akakanch.com
#
from math import pow
@ankanch
ankanch / hmmc.js
Last active October 6, 2020 14:54
How much money do I cost on Steam?
function hmmc(){
// ==UserScript==
// @name HMMC - How much money have I spent on steam
// @namespace https://akakanch.com/hmmc/
// @version 0.4
// @description just buy games,steam sales are great deals. why this script?
// @author Kanch
// @match https://store.steampowered.com/account/history/
// @grant none
// @name:zh-CN HMMC - 我在Steam上花了多少钱了
@ankanch
ankanch / getlocalIP.go
Created October 25, 2017 13:13
[Golang] Get Public IP address via Public IP API
package main
import (
"fmt"
"io/ioutil"
"net/http"
)
func main() {
url := "https://api.ipify.org?format=text" // we are using a pulib IP API, we're using ipify here, below are some others
// https://www.ipify.org
// http://myexternalip.com
@ankanch
ankanch / test1.py
Created September 5, 2017 11:25
Tutorial of theano
from theano import function, config, shared, tensor
import numpy
import time
vlen = 10 * 30 * 768 # 10 x #cores x # threads per core
iters = 1000
rng = numpy.random.RandomState(22)
x = shared(numpy.asarray(rng.rand(vlen), config.floatX))
f = function([], tensor.exp(x))
@ankanch
ankanch / DoMo-Pred-gsoc2017-LongZhang.md
Last active April 18, 2019 14:32
Developing a web interface for DoMo-Pred, the protein interactions prediction tool | GSoC 2017 Code Submission by Long Zhang