Skip to content

Instantly share code, notes, and snippets.

@cdpath
cdpath / wechat.json
Last active December 11, 2024 02:25
使用 Huginn 实现微信公众号全文 RSS
{
"schema_version": 1,
"name": "WeChat",
"description": "微信公众号全文 RSS",
"source_url": false,
"guid": "dd67102f09869c2228f8ed903a32d063",
"tag_fg_color": "#333333",
"tag_bg_color": "#66ff66",
"icon": "leaf",
"exported_at": "2019-01-12T10:56:41Z",
-- credit
-- https://medium.com/@igloude/using-applescript-and-btt-to-make-the-airpods-experience-a-little-bit-better-6e78b12d33bd
tell application "System Events" to tell process "SystemUIServer"
set bt to (first menu bar item whose description is "bluetooth") of menu bar 1
click bt
tell (first menu item whose title is "YOUR_DEVICE_NAME") of menu of bt
click
tell menu 1
if exists menu item "Connect" then
@cdpath
cdpath / convert.py
Last active November 28, 2017 03:39
Marvin(iOS) annotations to My Clippings.txt(Kindle)
# -*- coding: utf-8 -*-
import csv
import locale
import datetime as dt
from collections import namedtuple
def clean_bom(lines):
@cdpath
cdpath / test_threading.py
Last active January 15, 2018 09:00
Python threading with Exception catching
#!/usr/bin/python
# -*- coding: utf-8 -*-
from time import sleep
import sys
import threading
import Queue
ERROR_OCCURRED = object()
@cdpath
cdpath / app.py
Created January 24, 2018 07:28
requests with msgpack
import msgpack
from flask import Flask, request, jsonify
from flask.wrappers import Request
class RequestWithMsgPackSupport(Request):
@property
def is_msgpack(self):
return self.mimetype == 'application/msgpack'
@cdpath
cdpath / join.py
Created March 6, 2018 10:28
join() method of thread
import threading
import logging
from time import sleep
logging.basicConfig(level=logging.DEBUG,
format='(%(threadName)-10s) %(message)s',
)
@cdpath
cdpath / anki.CSS
Created May 2, 2018 14:32
anki template
ruby rt {
visibility: hidden;
}
ruby:hover rt {
visibility: visible;
}
.card {
font-family: Noto Sans CJK JP Regular;
@cdpath
cdpath / full_text_rss.json
Created May 14, 2018 11:08
Full-text RSS with Huginn
{
"schema_version": 1,
"name": "RSS",
"description": "Design Daily",
"source_url": false,
"guid": "34862db1b1318cda2d8b50a94908ffa3",
"tag_fg_color": "#ffffff",
"tag_bg_color": "#ff8000",
"icon": "signal",
"exported_at": "2018-05-14T11:06:25Z",
@cdpath
cdpath / GRE6000.txt
Last active June 9, 2018 14:44
corpus
* Word Tree / Roget's Thesaurus
* Class I. Words Expressing Abstract Relations
** Section I. Existence
*** 1. Being, in The Abstract
***** existence 1