Skip to content

Instantly share code, notes, and snippets.

View dwdcth's full-sized avatar

banshan dwdcth

  • Mens et Manus
View GitHub Profile
@dwdcth
dwdcth / agent loop
Created March 10, 2025 06:33 — forked from jlia0/agent loop
Manus tools and prompts
You are Manus, an AI agent created by the Manus team.
You excel at the following tasks:
1. Information gathering, fact-checking, and documentation
2. Data processing, analysis, and visualization
3. Writing multi-chapter articles and in-depth research reports
4. Creating websites, applications, and tools
5. Using programming to solve various problems beyond development
6. Various tasks that can be accomplished using computers and the internet
@dwdcth
dwdcth / bleve_with_jieba.go
Created May 16, 2023 08:14 — forked from oblank/bleve_with_jieba.go
bleve结合 jieba 分词实现中文分词
package main
import (
"fmt"
"github.com/blevesearch/bleve"
_ "github.com/wangbin/jiebago/analyse/tokenizers"
"log"
)
func main() {
@dwdcth
dwdcth / anki_algorithm.py
Created July 22, 2022 07:45 — forked from riceissa/anki_algorithm.py
my current understanding of Anki's spacing algorithm
"""
This is my understanding of the Anki scheduling algorithm, which I mostly
got from watching https://www.youtube.com/watch?v=lz60qTP2Gx0
and https://www.youtube.com/watch?v=1XaJjbCSXT0
and from reading
https://faqs.ankiweb.net/what-spaced-repetition-algorithm.html
There is also https://github.com/dae/anki/blob/master/anki/sched.py but I find
it really hard to understand.
Things I don't bother to implement here: the random fudge factor (that Anki
@dwdcth
dwdcth / process.sh
Created September 28, 2017 13:31 — forked from d6y/process.sh
Batch convert HTML to Markdown
#!/bin/bash
# Converts HTML from https://exportmyposts.jazzychad.net/ exports to Markdown
POSTS_DIR=/Users/richard/Desktop/d6y/posts
for file in $POSTS_DIR/*.html
do
echo $file
@dwdcth
dwdcth / html_to_md.bat
Created September 28, 2017 13:23
html_to_md use pandoc
@ECHO OFF
SETLOCAL
SET "sourcedir=U:\sourcedir"
PUSHD "%sourcedir%"
FOR /f "delims=" %%a IN (
'dir /b /s /a-d *.md *.html '
) DO (
IF /i "%%~xa"==".md" (
IF NOT EXIST "%%~dpna.html" ECHO pandoc "%%a" -f markdown -t html -o "%%~dpna.html"
) ELSE (

配置 shadowsocks

架设好 shadowsocks 服务端,在路由器上安装 shadowsocks 客户端,并配置 /etc/config/shadowsocks.json ,假设本地监听端口为 1080 。启动 shadowsocks

/etc/init.d/shadowsocks start

配置 privoxy

安装 privoxy openwrt 版。

@dwdcth
dwdcth / table.c
Created June 25, 2012 13:24
GTK:table
/*格状容器table.c*/
#include<gtk/gtk.h>
int main(int argc, char*argv[])
{
GtkWidget *window;
GtkWidget *table;
GtkWidget *button1;
GtkWidget *button2;
GtkWidget *button3;
@dwdcth
dwdcth / filechooser_dialog.c
Created June 23, 2012 08:35 — forked from bert/filechooser_dialog.c
GTK Filechooser dialog
/*!
* \file filechooser_dialog.c
* \author Copyright 2007, 2008, 2009, 2010 by Bert Timmerman <[email protected]>
* \brief Functions for a filechooser dialog (GTK UI).
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.\n
* \n
@dwdcth
dwdcth / LabelPanel.java
Created June 23, 2012 08:24 — forked from ProgDan/LabelPanel.java
Exemplo: Java Swing - Label
import java.awt.*;
import javax.swing.*;
public class LabelPanel extends JPanel {
public LabelPanel() {
JLabel plainLabel = new JLabel("Plain Small Label");
add(plainLabel);
JLabel fancyLabel = new JLabel("Fancy Big Label");
@dwdcth
dwdcth / stl_queue.cpp
Created June 23, 2012 08:24 — forked from ProgDan/stl_queue.cpp
Exemplo: STL Queue
#include <iostream>
#include <queue>
using namespace std;
int menu(){
int op;
cout << "Menu" << endl;
cout << endl << "1) Inserir elemento na fila";
cout << endl << "2) Remover elemento da fila";