This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Prepare file download | |
// Special Thanks: https://www.skoumal.net/en/making-utf-8-csv-excel/ | |
$filename = 'some_file_name.csv'; | |
//headers | |
header('Pragma: public'); | |
header('Expires: 0'); | |
header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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"] = ["8.8.8.8", "8.8.4.4"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @package Woocommerce Product Category List | |
* @version 1.0 | |
*/ | |
/* | |
Plugin Name: Woocommerce Product Category List table | |
Plugin URI: https://www.linkedin.com/in/elleryleung | |
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Python 2 Script. It works as of 17 May 2017 | |
import os | |
if "CONNECTED" not in os.popen("/usr/bin/openssl s_client -connect 192.168.1.15:25 | /bin/grep '^CONNECTED'").read(): | |
# Note about sending email using Gmail SMTP | |
# https://www.digitalocean.com/community/tutorials/how-to-use-google-s-smtp-server | |
# http://stackoverflow.com/questions/20337040/gmail-smtp-debug-error-please-log-in-via-your-web-browser | |
# How to send email using Linux Command: http://www.binarytides.com/linux-mailx-command/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Use HTTP/2 send APNS Example main reference | |
=========================================== | |
http://gobiko.com/blog/token-based-authentication-http2-example-apns/ | |
Error 410 to detect uninstalls | |
============================== | |
https://leftshift.io/mobile-tracking-uninstalls-on-ios-and-android | |
https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CommunicatingwithAPNs.html#//apple_ref/doc/uid/TP40008194-CH11-SW1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/python3 | |
''' | |
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: | |
=============== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from oauth2client.service_account import ServiceAccountCredentials | |
import httplib2 | |
import json | |
import pandas as pd | |
# https://developers.google.com/search/apis/indexing-api/v3/prereqs#header_2 | |
JSON_KEY_FILE = "json_key_file_downloaded_after_creating_your_google_service_account_see_above_details_on_how_to_do.json" | |
SCOPES = ["https://www.googleapis.com/auth/indexing"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* One of my task is to create a function that find the next business day. | |
* | |
* Reference: https://stackoverflow.com/a/5532070/1802483 | |
*/ | |
class GetNextBusinessDay{ | |
// Get a list of holiday in https://holidayapi.com/. Then I copy, paste and edit it manually to make this list | |
private $holidayList = [ | |
"2020-04-04", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
♔ | |
♕ | |
♖ | |
♗ | |
♘ | |
♙ | |
♚ | |
♛ | |
♜ | |
♝ |
OlderNewer