Skip to content

Instantly share code, notes, and snippets.


Terry L. terrylinooo

View GitHub Profile
nczz / class.plugin-modules.php
Last active Oct 22, 2019
WP_VCD SAMPLE CODE 盜版軟體夾藏的病毒碼 | [WordPress] WP_VCD 盜版軟體病毒解析 >
View class.plugin-modules.php
ini_set('display_errors', 0);
damiencarbery / conditional-wc-email-sending.php
Last active Nov 8, 2021
Conditionally send WooCommerce emails: Dynamically determine whether to send a WooCommerce email.
View conditional-wc-email-sending.php
Plugin Name: Conditionally send WooCommerce emails
Plugin URI:
Description: Dynamically determine whether to send a WooCommerce email.
Author: Damien Carbery
Version: 0.2
// The filter name is 'woocommerce_email_enabled_'.WC_Email::id e.g. 'new_order', 'cancelled_order' etc
cecilemuller /
Last active Nov 26, 2021
How to create an HTTPS certificate for localhost domains

How to create an HTTPS certificate for localhost domains

This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.

Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).

cferdinandi / myplugin-media.js
Last active Nov 7, 2021
Adding a Media Uploader to a custom metabox
View myplugin-media.js
* Load media uploader on pages with our custom metabox
'use strict';
// Instantiates the variable that holds the media library frame.
var metaImageFrame;
gangsta /
Last active Nov 9, 2021
How to Setting Up a Comodo SSL Cert

How to Setting Up a Comodo SSL Cert

  • I advice you to buy SSL Certs from officially Comodo only , or some SSL reseller whose you trust.

These are the steps I went through to set up an SSL cert. Purchase the cert

Prior to purchasing a cert, you need to generate a private key, and a CSR file (Certificate Signing Request). You’ll be asked for the content of the CSR file when ordering the certificate:

openssl req -new -newkey rsa:2048 -nodes -keyout example_com.key -out example_com.csr
DomenicF / get_current_post_type.php
Last active Mar 12, 2020 — forked from bradvin/get_current_post_type.php
Get the current post_type context in the WordPress admin.
View get_current_post_type.php
* gets the current post type in the WordPress Admin
function get_current_post_type() {
global $post, $typenow, $current_screen;
//we have a post so we can just get the post type from that
if ( $post && $post->post_type ) {
return $post->post_type;
moneytoo / gist:ab3f34e4fddc2110675952f8280f49c5
Last active Mar 22, 2020
nginx with OpenSSL 1.0.2 (ALPN) on CentOS 7, also available from
View gist:ab3f34e4fddc2110675952f8280f49c5
### No longer needed as of nginx-1.13.6-1.el7_4.ngx.x86_64.rpm from
### it was compiled against OpenSSL 1.0.2 from CentoOS 7.4 so it supports ALPN (HTTP2 works)
yum -y groupinstall 'Development Tools'
yum -y install wget openssl-devel libxml2-devel libxslt-devel gd-devel perl-ExtUtils-Embed GeoIP-devel rpmdevtools
nkt /
Last active Nov 4, 2021
ReactPHP vs Node.js

wrk -t4 -c400 -d10s


Running 10s test @
  4 threads and 400 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     7.02ms    6.94ms  82.86ms   85.27%
carlessanagustin /
Last active Nov 26, 2021
For unattended installations in Debian Linux environments
v0lkan / nginx.conf
Last active Nov 21, 2021
Configuring NGINX for Maximum Throughput Under High Concurrency
View nginx.conf
user web;
# One worker process per CPU core.
worker_processes 8;
# Also set
# /etc/security/limits.conf
# web soft nofile 65535
# web hard nofile 65535
# /etc/default/nginx