Skip to content

Instantly share code, notes, and snippets.

View MerleLiuKun's full-sized avatar
🎯
Focusing

klein MerleLiuKun

🎯
Focusing
View GitHub Profile
@zjnxyz
zjnxyz / 唯一邀请码生成方法
Created June 9, 2018 03:33
唯一邀请码生成方法,通过算法实现,唯一第三方组件来判断邀请码是否唯一!!!
/**
* 随机字符串
*/
private static final char[] CHARS = new char[] {'F', 'L', 'G', 'W', '5', 'X', 'C', '3',
'9', 'Z', 'M', '6', '7', 'Y', 'R', 'T', '2', 'H', 'S', '8', 'D', 'V', 'E', 'J', '4', 'K',
'Q', 'P', 'U', 'A', 'N', 'B'};
private final static int CHARS_LENGTH = 32;
/**
* 邀请码长度
@leohxj
leohxj / .cz-config.js
Last active May 19, 2023 03:49
cz-customizable with emoji
'use strict';
module.exports = {
types: [
{
value: 'WIP',
name : '💪 WIP: Work in progress'
},
{
@sclark39
sclark39 / InstagramIdConvert.js
Last active July 2, 2024 12:59
Convert from Instagram Shortcode to Id and Back using big-integer
var bigint = require( 'big-integer' )
var lower = 'abcdefghijklmnopqrstuvwxyz';
var upper = lower.toUpperCase();
var numbers = '0123456789'
var ig_alphabet = upper + lower + numbers + '-_'
var bigint_alphabet = numbers + lower
function toShortcode( longid )
@hmldd
hmldd / scroll.py
Last active October 6, 2023 14:59
Example of Elasticsearch scrolling using Python client
# coding:utf-8
from elasticsearch import Elasticsearch
import json
# Define config
host = "127.0.0.1"
port = 9200
timeout = 1000
index = "index"
@xiaobailong24
xiaobailong24 / IDE-Atom.md
Created October 20, 2016 03:06
Atom 使用笔记

Atom 设置和取消代理

设置Shadowsocks代理

apm config set http-proxy socks5:127.0.0.1:1080
apm config set https-proxy socks5:127.0.0.1:1080

取消ssl

apm config set strict-ssl false
@edsu
edsu / replies.py
Last active December 7, 2022 18:59
Try to get replies to a particular set of tweets, recursively.
#!/usr/bin/env python
"""
Twitter's API doesn't allow you to get replies to a particular tweet. Strange
but true. But you can use Twitter's Search API to search for tweets that are
directed at a particular user, and then search through the results to see if
any are replies to a given tweet. You probably are also interested in the
replies to any replies as well, so the process is recursive. The big caveat
here is that the search API only returns results for the last 7 days. So
@tomysmile
tomysmile / mac-setup-redis.md
Last active June 27, 2024 00:23
Brew install Redis on Mac

type below:

brew update
brew install redis

To have launchd start redis now and restart at login:

brew services start redis