Skip to content

Instantly share code, notes, and snippets.

@logonod
logonod / redis_migrate.py
Created May 27, 2019 03:21 — forked from josegonzalez/redis_migrate.py
A simple script to migrate all keys from one Redis to another
#!/usr/bin/env python
import argparse
import redis
def connect_redis(conn_dict):
conn = redis.StrictRedis(host=conn_dict['host'],
port=conn_dict['port'],
db=conn_dict['db'])
return conn
mongod --port 27020 --dbpath ./ --replSet foo
docker run --name arbiter -p 27020:27020 --net=host -it logonod/mongo:v1
rs.initiate( {
_id : "foo",
members: [
{ _id: 0, host: "127.0.0.1:27017" },
{ _id: 1, host: "127.0.0.1:27018" }
]
@logonod
logonod / LICENCE SUBLIME TEXT
Created November 19, 2018 06:33
Sublime Text 3 Serial key build is 3176
## Sublime Text 3 Serial key build is 3176
> * Added these lines into /etc/hosts
127.0.0.1 www.sublimetext.com
127.0.0.1 license.sublimehq.com
> * Used the license key
----- BEGIN LICENSE -----
@logonod
logonod / note.md
Created August 8, 2018 03:58
性能调研

前端性能调研报告


性能影响了用户体验。加载的延迟、操作的卡顿等都会影响用户的使用体验。报告主要针对一下几个方面进行调研

  • 浏览器运行机制
  • 页面性能评测工具
  • 页面性能指标
  • 如何采集页面性能数据
my learning list
@logonod
logonod / extract-sougou-dict.py
Created September 7, 2016 07:18
从搜狗词库提取词组
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# @author: [email protected]
# @date: 2014-09-03
# @depends: python2.7+
'''
从搜狗词库中提取中文词组
参考[这篇文章](http://blog.csdn.net/zhangzhenhu/article/details/7014271)中的代码实现。
@logonod
logonod / pagerank.py
Created November 24, 2015 07:02 — forked from diogojc/pagerank.py
python implementation of pagerank
import numpy as np
from scipy.sparse import csc_matrix
def pageRank(G, s = .85, maxerr = .001):
"""
Computes the pagerank for each of the n states.
Used in webpage ranking and text summarization using unweighted
or weighted transitions respectively.