Skip to content

Instantly share code, notes, and snippets.

😁
Focusing

YieldNull

😁
Focusing
Block or report user

Report or block YieldNull

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@YieldNull
YieldNull / multithread_logging.py
Last active Jan 4, 2019
multithread_logging.py
View multithread_logging.py
import sys
import logging
from multiprocessing.pool import Pool
logging.basicConfig(stream=sys.stdout, level=logging.INFO,
format='%(asctime)s - %(processName)s %(threadName)s - %(name)s - %(levelname)s - %(message)s')
if __name__ == "__main__":
def job(name):
logger = logging.getLogger(name)
View ScalaInMemoryCompiler.scala
import scala.tools.nsc.{Global, Settings}
import scala.reflect.internal.util.BatchSourceFile
import tools.nsc.io.{VirtualDirectory, AbstractFile}
import scala.reflect.internal.util.AbstractFileClassLoader
import java.security.MessageDigest
import java.math.BigInteger
import collection.mutable
import java.io.File
object CompileTest {
@YieldNull
YieldNull / multi_downloader.py
Created Nov 8, 2018
A Multithread Downloader
View multi_downloader.py
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)
@YieldNull
YieldNull / Sorting.py
Created Sep 5, 2016
Sorting algorithms
View Sorting.py
#!/usr/bin/env python3
"""
Sorting algorithms
Created By YieldNull at 4/14/16
"""
def insertion_sort(lst):
@YieldNull
YieldNull / WHU.java
Last active Apr 14, 2017
登陆武汉大学教务系统
View WHU.java
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 / create.sh
Created Feb 25, 2016
Build A Website With Python-Flask and Nginx
View create.sh
#!/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 / hexout.c
Created Nov 21, 2015
Display memory block via Hexadecimal.
View hexout.c
#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 / readme.md
Created Nov 17, 2015
备份QQ空间说说
View readme.md

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

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

{
	"shuoshuo":"<shuoshuo_cookie>",
	"friends":"<friends_cookie>",
@YieldNull
YieldNull / download.py
Last active Nov 17, 2015
将飞图网某页面下所有发布在百度云上的资源转存到百度云,并下载,解压再上传
View download.py
#!/usr/bin/env python
#coding:utf-8
"""
download files from pan.baidu.com using https://github.com/PeterDing/iScript/blob/master/pan.baidu.com.py#pan.baidu.com.py
use crontab to run it in a specific time interval to check if it has failed
if failed, restart it
Created on 2015.10.31
"""
@YieldNull
YieldNull / goslate.py
Created Nov 17, 2015
Translate English and Chinese mutually using https://translate.google.com.hk
View goslate.py
#!/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
You can’t perform that action at this time.