Skip to content

Instantly share code, notes, and snippets.

View dingmaotu's full-sized avatar

Ding Li dingmaotu

View GitHub Profile
@dingmaotu
dingmaotu / find_dup_bookmarks.py
Last active September 11, 2023 03:49
Find duplicates in your bookmarks
# -*- coding: utf-8 -*-
"""
Find duplicates in your bookmarks.
Usage:
python find_dup_bookmarks.py /path/to/your/Bookmarks
Chrome saves your bookmarks in a json file.
For macOS, it is `/Users/{your user name}/Libaray/Application Support/Chrome/Default/Bookmarks`.
@dingmaotu
dingmaotu / mql4-and-mql5-zmq-binding.md
Last active September 6, 2023 18:37
mql4-and-mql5-zmq-binding

MQL4 and MQL5 Binding

This binding is for MQL4 Language (used by MetaTrader 4 Terminal) and MQL5 Language (used by MetaTrader 5 Terminal).

Source Code

https://github.com/dingmaotu/mql-zmq

Bug Reporting

@dingmaotu
dingmaotu / fast-remove-redis-keys.py
Created August 9, 2019 14:51
fast way to remove large number of redis keys by pattern
# to remove all keys matching a pattern in redis
# we could use the recommended way: redis-cli --scan --pattern 'abc:*' | xargs redis-cli del
# but this can be very slow if you have lots of data (like 8G redis cluster)
# we can use the following script to remove keys (considerably faster)
import time
import logging
from rediscluster import StrictRedisCluster
logger = logging.getLogger(__name__)