Skip to content

Instantly share code, notes, and snippets.

View YieldNull's full-sized avatar
😃

YieldNull

😃
View GitHub Profile
@YieldNull
YieldNull / neteasy.py
Last active October 26, 2015 12:26
Backup your neteasy blog entries to a sqlite3 database (备份网易博客)
#!/usr/bin/env python
# coding:utf-8
"""
Backup your neteasy blog entries to a sqlite3 database
Usage neteasy.py <username>
The username is your blog name which appears in your blog domain.
Just like "junjie.blog.163.com", in which "junjie" is the <username>
@YieldNull
YieldNull / goslate.py
Created November 17, 2015 13:47
Translate English and Chinese mutually using https://translate.google.com.hk
#!/usr/bin/env python
# coding:utf-8
"""
Translate English and Chinese mutually using https://translate.google.com.hk
create on '11/5/15 5:07 PM'
"""
import gzip
import httplib
@YieldNull
YieldNull / ruijie.py
Last active November 17, 2015 15:43
Login in WHU Dormitory Network(登陆武汉大学宿舍校园网)网页认证
#!/usr/bin/env python
# coding:utf-8
"""
Login in WHU Dormitory Network
Usage:
Usage: ruijie.py [-l]
-l to logout
@YieldNull
YieldNull / hexout.c
Created November 21, 2015 07:02
Display memory block via Hexadecimal.
#include <stdio.h>
/**
* Display memory block via Hexadecimal.
* From lower to higher address.
**/
void hexOut(unsigned char c) {
printf("%x", c & 0xF);
printf("%x", (c >> 4) & 0xF);
@YieldNull
YieldNull / create.sh
Created February 25, 2016 12:10
Build A Website With Python-Flask and Nginx
#!/bin/bash
# Build A Website With Python-Flask and Nginx
# Doc: http://yieldnull.com/blog/0b2e0169df807bec78b3ad3eea87105a2e5299c6/
# http://yieldnull.com/blog/cd7be487eb5148eb4aa905543c1fd1396b618a6b/
# Author: YieldNull
# Updated On: 2016/02/25
if [ ! $# = 3 ] ; then
echo "Args: project_name port domain_name"
@YieldNull
YieldNull / Sorting.py
Created September 5, 2016 11:44
Sorting algorithms
#!/usr/bin/env python3
"""
Sorting algorithms
Created By YieldNull at 4/14/16
"""
def insertion_sort(lst):
@YieldNull
YieldNull / WHU.java
Last active April 14, 2017 07:14
登陆武汉大学教务系统
package whu;
import java.awt.*;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;
import java.nio.file.Files;
import java.nio.file.StandardCopyOption;
import java.util.HashMap;
@YieldNull
YieldNull / R2LParser.c
Created November 1, 2015 12:44
Recognize C Pointer Declaration(识别C语言指针表达式)
/*
* R2LParser.c
*
* Recognize C declaration use Right-Left Method(from http://ieng9.ucsd.edu/~cs30x/rt_lt.rule.html)
*
* The "right-left" rule is a completely regular rule for deciphering C
* declarations. It can also be useful in creating them.
*
* First, symbols. Read
* * as "pointer to" - always on the left side
@YieldNull
YieldNull / readme.md
Created November 17, 2015 15:27
备份QQ空间说说

#功能 备份QQ空间说说(先用浏览器登陆获取Cookie)

#用法 先将Cookie及用户写入config.json中,格式如下

{
	"shuoshuo":"<shuoshuo_cookie>",
	"friends":"<friends_cookie>",
@YieldNull
YieldNull / multi_downloader.py
Created November 8, 2018 04:02
A Multithread Downloader
import os
import logging
import requests
from multiprocessing.pool import ThreadPool
from multiprocessing import Queue
def download(task_file, repository, pool_size=8):
logger = logging.getLogger('downloader')
logging.basicConfig(stream=sys.stdout, level=logging.INFO)