Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View clarkzjw's full-sized avatar
🌴

Jinwei Zhao clarkzjw

🌴
View GitHub Profile
@clarkzjw
clarkzjw / docker-compose.yml
Created January 10, 2017 06:36
MongoDB-Sharded-Cluster-ReplicaSet
version: '2'
services:
mongo-config1:
image: mongo
container_name: mongo-config1
command: [mongod, --configsvr, --replSet, my-mongo-set, --dbpath, /data/db]
ports:
- "27019"
networks:
- mongo-net
@clarkzjw
clarkzjw / docker-compose.yml
Created January 10, 2017 05:13
三节点MongoDB副本集
version: '2'
services:
mongo1:
image: mongo
container_name: mongo1
command: [mongod, --replSet, my-mongo-set, --dbpath, /data/db]
networks:
- mongo-net
mongo2:
image: mongo
@clarkzjw
clarkzjw / docker-compose.yml
Last active January 10, 2017 05:12
Prometheus
version: '2'
volumes:
prometheus_data: {}
grafana_data: {}
services:
swarm_exporter:
image: daocloud.io/daocloud/swarm_exporter:0.1.1
labels:
io.daocloud.dce.compose.placement.constraints: '["node.role == manager"]'
@clarkzjw
clarkzjw / LumberJack.py
Last active October 23, 2016 05:17
Telegram game LumberJack bot, require Python3 and PyAutoGUI, the coordinates are for the left side of 1366*768 screen.
from pyautogui import *
from time import sleep
def move(_pos, _now):
if _pos == 'left' and _now == 'left':
typewrite(['left'])
typewrite(['left'])
elif _pos == 'left' and _now == 'right':
typewrite(['right'])

Keybase proof

I hereby claim:

  • I am clarkzjw on github.
  • I am clarkzjw (https://keybase.io/clarkzjw) on keybase.
  • I have a public key whose fingerprint is B878 C370 CF7D 871F AA3C 7663 7E1E B185 1D01 7D3D

To claim this, I am signing this object:

from twython import Twython, TwythonError
import time
import sys
APP_KEY = ''
APP_SECRET = ''
OAUTH_TOKEN = ''
OAUTH_TOKEN_SECRET = ''
twitter = Twython(APP_KEY, APP_SECRET, OAUTH_TOKEN, OAUTH_TOKEN_SECRET)
Windows Registry Editor Version 5.00
[-HKEY_USERS\S-1-5-21-3156065619-4242713678-38689869-1001_Classes\directory\background\shell\Atom]
[-HKEY_USERS\S-1-5-21-3156065619-4242713678-38689869-1001\Software\Classes\directory\background\shell\Atom]
[-HKEY_CURRENT_USER\Software\Classes\directory\background\shell\Atom]
#include <thrust/host_vector.h>
#include <thrust/device_vector.h>
#include <thrust/generate.h>
#include <thrust/sort.h>
#include <thrust/copy.h>
#include <iostream>
#include <algorithm>
#include <ctime>
#include <cstdlib>
void CHowOldDlg::OnBnClickedButton1()
{
cv::Mat img = cv::imread("res/Test.jpeg");
CDC *pDC = GetDlgItem(IDC_Pic)->GetDC();
HDC hDC = pDC->GetSafeHdc();
CRect rect;
GetDlgItem(IDC_Pic)->GetClientRect(&rect);
int rw = rect.right - rect.left; //the width of your picture control
int rh = rect.bottom - rect.top;
if (!img.data){
#include <stdio.h>
int main()
{
char *str = "HelloWorld";
int a = *(int *)str;
if (a == 0x6c6c6548)
printf("Little endian\n");
else if (a == 0x48656c6c)
printf("Big endian\n");
return 0;