Skip to content

Instantly share code, notes, and snippets.

View staticor's full-sized avatar

SteveYagn staticor

View GitHub Profile
@staticor
staticor / mongo.writer.json
Created December 28, 2018 08:44
datax example mongo writer
{
"job": {
"setting": {
"speed": {
"channel": 2
}
},
"content": [
{
"reader": {
@staticor
staticor / mysql.writer.json
Created December 28, 2018 08:29
datax example hive -> mysql
{
"job": {
"setting": {
"speed": {
"channel": 1
}
},
"content": [
{
"reader": {
@staticor
staticor / sqoop_example.sh
Created December 28, 2018 08:20
sqoop example for import and export data
function sqoop_import_data() {
sqoop import -D mapreduce.job.queuename=mapreduce.normal \
--connect 'jdbc:mysql://123.123.123.123/optimus?useUnicode=true&characterEncoding=GBK' \
--username data \
--password 'password' \
--query " SELECT '' as id,
day,
agent,
register_name,
@staticor
staticor / pool_test.py
Created December 20, 2018 15:29
multiprocess pool test
import multiprocessing as mp
def job(x):
return x * x
pool = mp.Pool()
res = pool.map(job, range(10))
@staticor
staticor / mp_test.py
Last active December 20, 2018 15:22
multiprocess test
import multiprocessing as mp
import threading as td
def job(a, d):
print('aaaaa')
if __name__ == '__main__':
@staticor
staticor / threading_test.py
Last active December 20, 2018 14:38
two thread work at same time, and output missy.
import threading
def job1():
global A
for i in range(10):
A+=1
print('job1',A)
def job2():
global A
@staticor
staticor / gil_test.py
Created December 20, 2018 14:20
GIL is not efficient as you wish.
import threading
from multiprocessing import Queue
import copy
import time
def job(l, q):
res = sum(l)
q.put(res)
def multithreading(l):
@staticor
staticor / beeline_args.sh
Created December 18, 2018 15:31
beeline useful list (The Beeline CLI 支持以下命令行参数)
Option/Description
--autoCommit=[true/false]    
Enable/disable automatic transaction commit. Default is false.
Usage: beeline --autoCommit=true
--autosave=[true/false]    
Automatically save preferences (true) or do not autosave (false). Default is false.
Usage: beeline --autosave=true
--color=[true/false]    
Control whether color is used for display. Default is false.
@staticor
staticor / default.custom.yaml
Last active April 2, 2020 21:26
Rime input method configuration - default.custom.yaml
patch:
menu:
page_size: 7 # 设置候选字数量 个人喜好 7
schema_list:
- schema: wubi_pinyin # 五笔拼音混合輸入 偶尔生字需要拼音
- shcema: luna_pinyin_simp # luna 拼音 个人几乎不用
#下面定义“输入选单”的切换控制
switcher:
@staticor
staticor / active.md
Created December 12, 2018 10:42 — forked from lotem/active.md

Most active GitHub users (git.io/top)

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Sat, 22 Dec 2012 23:34:58 GMT till Sun, 22 Dec 2013 23:34:58 GMT.

Only first 1000 GitHub users according to the count of followers are taken. This is because of limitations of GitHub search. Sorting algo in pseudocode:

githubUsers
 .filter((user) -> user.followers > 229)