Skip to content

Instantly share code, notes, and snippets.

(defun run-ask-ollama ()
(interactive)
(let ((background (buffer-string))
(question (read-from-minibuffer "What's your question? "))
(buff (get-buffer-create "ollama")))
(start-process "ollama" buff "ask_ollama.py" "-e" "http://127.0.0.1:11434" "-m" "deepseek-r1:14b" "-fi" question)
(process-send-string "ollama" background)
(process-send-eof "ollama")
(switch-to-buffer buff)))
@shell909090
shell909090 / cleanup_weixin.py
Last active August 26, 2024 03:32
清理微信公众号链接,用法:python3 cleanup_weixin.py -c == pbpaste | python3 cleanup_weixin.py -i | pbcopy
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
@date: 2024-07-22
@author: Shell.Xu
@copyright: 2024, Shell.Xu <[email protected]>
@license: BSD-3-clause
'''
import sys
import argparse
import json
import time
import hashlib
import requests
def sha256sum(s):
h = hashlib.sha256()
h.update(s.encode('utf-8'))