Skip to content

Instantly share code, notes, and snippets.

🌴
On vacation

wind smileboywtu

🌴
On vacation
Block or report user

Report or block smileboywtu

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
@smileboywtu
smileboywtu / python-smtp-send-qq-mail.py
Created May 8, 2017 — forked from binderclip/python-smtp-send-qq-mail.py
Python & Email,附上用 Python 发送 QQ 邮箱邮件的代码
View python-smtp-send-qq-mail.py
import smtplib
from getpass import getpass
def prompt(prompt):
return input(prompt).strip()
fromaddr = prompt("From: ")
toaddrs = prompt("To: ").split()
subject = prompt("Subject: ")
print("Enter message, end with ^D (Unix) or ^Z (Windows):")
@smileboywtu
smileboywtu / cuter.py
Created May 11, 2017 — forked from sigilioso/cuter.py
Python PIL Example: get a thumbnail by resizing and cropping an image.
View cuter.py
# -*- coding: utf-8 -*-
import Image
def resize_and_crop(img_path, modified_path, size, crop_type='top'):
"""
Resize and crop an image to fit the specified size.
args:
img_path: path for the image to resize.
@smileboywtu
smileboywtu / send_email.py
Created May 25, 2017 — forked from lavr/send_email.py
std email vs emails
View send_email.py
# see also: http://code.activestate.com/recipes/578150-sending-non-ascii-emails-from-python-3/
import os
import smtplib
from email.utils import formataddr
from email.utils import formatdate
from email.utils import COMMASPACE
from email.header import Header
@smileboywtu
smileboywtu / py3.5_ubuntu_14.04.txt
Created Jun 30, 2017 — forked from larainema/py3.5_ubuntu_14.04.txt
how to install python3.5 on ubuntu 14.04
View py3.5_ubuntu_14.04.txt
Felix Krull runs a PPA offering basically any version of Python (seriously, there is 2.3.7 build for vivid...) for many Ubuntu releases at
https://launchpad.net/~fkrull/+archive/ubuntu/deadsnakes
Do the usual:
sudo add-apt-repository ppa:fkrull/deadsnakes
sudo apt-get update
sudo apt-get install python3.5
It will not overwrite your existing python3.4 which is still symlinked as python3. If you want python3.5 to be the default python3, change the symlink
@smileboywtu
smileboywtu / PicConverText.py
Created Jul 14, 2017 — forked from evi1m0/PicConverText.py
12306 新版验证码识别脚本 (已失效)
View PicConverText.py
#!/usr/bin/env python
# coding=utf8
# author=evi1m0
# website=linux.im
'''
12306 Captcha Picture:
author: Evi1m0@20150316
1. Download Captcha
2. Pic Conver Text
View Sublime Text 3 Build 3103 License Key - CRACK
I use the first
—– BEGIN LICENSE —–
Michael Barnes
Single User License
EA7E-821385
8A353C41 872A0D5C DF9B2950 AFF6F667
C458EA6D 8EA3C286 98D1D650 131A97AB
AA919AEC EF20E143 B361B1E7 4C8B7F04
@smileboywtu
smileboywtu / auto-run.py
Created Mar 29, 2018 — forked from mdwhatcott/auto-run.py
Auto-run `go test` in the console
View auto-run.py
#!/usr/bin/env python
"""
This script scans the current working directory for changes to .go files and
runs `go test` in each folder where *_test.go files are found. It does this
indefinitely or until a KeyboardInterrupt is raised (<Ctrl+c>). This script
passes the verbosity command line argument (-v) to `go test`.
"""
View connection-pool.py
class ConnectionPool():
"""
Usage:
conn_pool = nmi_mysql.ConnectionPool(config)
db = conn_pool.get_connection()
db.query('SELECT 1', [])
conn_pool.return_connection(db)
conn_pool.close()
@smileboywtu
smileboywtu / install-aria2-ui.sh
Created Jun 27, 2018 — forked from jae-jae/install-aria2-ui.sh
Ubuntu安装并配置aria2
View install-aria2-ui.sh
#!/bin/bash
#
# Ubuntu安装并配置aria2
#
# @Author: Jaeger <JaegerCode@gmail.com>
# @Version: 0.1
#配置文件下载保存路径
downloadPath='/user-files/superuser/dl'
@smileboywtu
smileboywtu / Dockerfile
Created Jun 30, 2018 — forked from orenitamar/Dockerfile
Installing numpy, scipy, pandas and matplotlib in Alpine (Docker)
View Dockerfile
# Below are the dependencies required for installing the common combination of numpy, scipy, pandas and matplotlib
# in an Alpine based Docker image.
FROM alpine:3.4
RUN echo "http://dl-8.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories
RUN apk --no-cache --update-cache add gcc gfortran python python-dev py-pip build-base wget freetype-dev libpng-dev openblas-dev
RUN ln -s /usr/include/locale.h /usr/include/xlocale.h
RUN pip install numpy scipy pandas matplotlib
You can’t perform that action at this time.