Skip to content

Instantly share code, notes, and snippets.

View kingofhawks's full-sized avatar
🎯
Focusing

kingofhawks kingofhawks

🎯
Focusing
View GitHub Profile
@kingofhawks
kingofhawks / pandas_max_column.py
Created February 26, 2014 08:47
pandas to get column max value
import pandas
import numpy as np
df = pandas.DataFrame(np.random.randn(5,3),columns=['A','B','C'])
df
df['A'].argmax()
df['A'].max()
@kingofhawks
kingofhawks / screen_phantomjs.js
Last active April 21, 2019 12:51
Use phantomjs to automatically do screenshot for web pages
var page = require('webpage').create();
page.viewportSize = { width: 500, height: 300 };
page.open('http://github.com/', function() {
//page.render('github.png');
page.render('github.pdf');//support PDF render also
phantom.exit();
});
@kingofhawks
kingofhawks / smtp_qq.py
Created January 17, 2014 08:15
send Mail via SMTP QQ
from email.mime.text import MIMEText
from smtplib import SMTP_SSL as SMTP #For TLS please use SMTP_SSL instead, such as QQ mail
#import smtplib
_user = "[email protected]"
_pwd = "xxxx"
_to = "[email protected]"
msg = MIMEText("Content")
@kingofhawks
kingofhawks / selenium_login_gmail.py
Created January 16, 2014 08:28
Use selenium to auto login gmail account
import time
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
driver= webdriver.Firefox()
#driver= webdriver.Chrome("E:\QA\Resource\WEBDRIVER\chromedriverserver\chromedriver.exe")
driver.get("http://mail.google.com")
@kingofhawks
kingofhawks / write_text_to_Image
Last active June 10, 2021 06:38
Add text to existing image with C# and merge with another image file
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Text;
using System.Threading.Tasks;
using System.Drawing;
using System.Drawing.Imaging;
using System.Drawing.Drawing2D;
using System.Drawing.Text;
@kingofhawks
kingofhawks / githubissues
Created October 10, 2013 03:38
export github issues to CSV files
__author__ = 'simon'
# coding=gbk
def export_csv(repository,target_csv):
import requests
resp = requests.get(url=repository)
#print resp.text
data = resp.json()
#print data