Skip to content

Instantly share code, notes, and snippets.

Ellery Leung alucard001

Block or report user

Report or block alucard001

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
alucard001 /
Created May 27, 2019
Google Indexing API V3 Working example with Python 3
from oauth2client.service_account import ServiceAccountCredentials
import httplib2
import json
import pandas as pd
JSON_KEY_FILE = "json_key_file_downloaded_after_creating_your_google_service_account_see_above_details_on_how_to_do.json"
SCOPES = [""]
alucard001 /
Last active Jun 24, 2019
Google Search API Working Example - Python 3 + MSSQL
This program is used to get all search terms in Google search console and save it in MSSQL DB.
Please note: Just using this .py is not enough. You need to create a Google service account in google API console and
connect that service account to Google search console property.
Points to note:
alucard001 /
Created Jun 2, 2017
Python Apple Push Notification HTTP/2 Example - Silent Push
Use HTTP/2 send APNS Example main reference
Error 410 to detect uninstalls
alucard001 /
Last active May 17, 2017
Python 2 Linux send email through Gmail using SMTP
# Python 2 Script. It works as of 17 May 2017
import os
if "CONNECTED" not in os.popen("/usr/bin/openssl s_client -connect | /bin/grep '^CONNECTED'").read():
# Note about sending email using Gmail SMTP
# How to send email using Linux Command:
alucard001 / woocommerce-product-category.php
Created Apr 30, 2017
WooCommerce Product Category List
View woocommerce-product-category.php
* @package Woocommerce Product Category List
* @version 1.0
Plugin Name: Woocommerce Product Category List table
Plugin URI:
Description: This plugin is just add a new shortcode: <code>[bp_product_category]</code> to list all product categories in div format.
Author: Ellery Leung
alucard001 /
Last active Jan 17, 2018
Using TPOT Classifier to analysis Numerai dataset
Largely come from TPOT example. The only control you can do to prevent timeout
and successful running is the "generation" and "population_size" parameters.
Remember, scoring is "log_loss" as of 18 Jan 2017, not probability
The larger the generation and population_size, the longer time you take to get result.
from tpot import TPOTClassifier
from sklearn.model_selection import train_test_split
alucard001 /
Last active Jan 18, 2017
Python Validate Email example script
# coding: utf-8
import pandas as pd
import numpy as np
from validate_email import validate_email
import sys
# Note: you may encounter error if you don't have pyDNS or pyDNS3 installed.
import DNS
DNS.defaults["server"] = ["", ""]
alucard001 / csv_for_excel.php
Created Jan 18, 2017
PHP CSV for Excel file download
View csv_for_excel.php
// Prepare file download
// Special Thanks:
$filename = 'some_file_name.csv';
header('Pragma: public');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
You can’t perform that action at this time.