Skip to content

Instantly share code, notes, and snippets.

View quangbahoa's full-sized avatar
🎯
Focusing

Le Duy Quang quangbahoa

🎯
Focusing
View GitHub Profile
@quangbahoa
quangbahoa / smsMail
Last active August 29, 2015 14:20 — forked from anonymous/smsMail
function smsMail()
{
try
{
var label = GmailApp.getUserLabelByName('smsMail');
var threads = label.getThreads();
var now = new Date().getTime();
var cal=getCalendar();
for(i in threads)
<?php
add_filter( 'woocommerce_checkout_fields' , 'woo_remove_billing_checkout_fields' );
/**
* Remove unwanted checkout fields
*
* @return $fields array
*/
function woo_remove_billing_checkout_fields( $fields ) {
@quangbahoa
quangbahoa / mywidget-basic.php
Last active August 29, 2015 14:27 — forked from pommiegranit/mywidget-basic.php
Playing with WordPress widgets
<?php
/*
Plugin Name: My Widget
Plugin URI: http://mydomain.com
Description: My first widget
Author: Me
Version: 1.0
Author URI: http://mydomain.com
*/
<!-- adding Contact Form 7 into Wordpress Template and removing <br> tags
add the following to the wordpress template -->
<?php echo do_shortcode('[contact-form-7 id="211" title="Spanish Contact Form"]') ; ?>
<!-- add the following into the wp-config.php -->
define ('WPCF7_AUTOP', false );
<!-- This will remove the <br> tags that get added automatically when you call Contact Form 7 from the template via shortcode-->
@quangbahoa
quangbahoa / list-terms.php
Created October 15, 2015 14:19 — forked from barbwiredmedia/list-terms.php
Wordpress list terms or categories from a custom post type. wp_list_categories
<?php//list terms in a given taxonomy using wp_list_categories (also useful as a widget if using a PHP Code plugin)
$taxonomy = 'Your_term_here';
$orderby = 'name';
$show_count = 0; // 1 for yes, 0 for no
$pad_counts = 0; // 1 for yes, 0 for no
$hierarchical = 1; // 1 for yes, 0 for no
$title = '';
$empty = 0;
@quangbahoa
quangbahoa / restrictions.conf
Created December 25, 2015 06:50 — forked from nhoffmann/restrictions.conf
Nginx global configuration files to ease the configuration of wordpress multisite installations under nginx/php-fpm. Simply import these configurations in your specific configuration
# Global restrictions configuration file.
# Designed to be included in any server {} block.</p>
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
@quangbahoa
quangbahoa / site-phalaionline
Last active January 4, 2016 06:46 — forked from hothanhan/site-phalaionline
site-phalaionline
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
#
# Generally, you will want to move this file somewhere, and start with a clean
# file but keep this around for reference. Or just disable in sites-enabled.
#
<!-- Google Code dành cho Thẻ tiếp thị lại -->
<!--------------------------------------------------
Không thể liên kết thẻ tiếp thị lại với thông tin nhận dạng cá nhân hay đặt thẻ tiếp thị lại trên các trang có liên quan đến danh mục nhạy cảm. Xem thêm thông tin và hướng dẫn về cách thiết lập thẻ trên: http://google.com/ads/remarketingsetup
--------------------------------------------------->
<script type="text/javascript">
var google_tag_params = {
ecomm_prodid: '<?php get_the_ID(); ?>',
ecomm_pagetype: 'singleproduct',
ecomm_totalvalue: '<?php echo $product->get_price_html(); ?>',
dynx_itemid: '<?php get_the_ID(); ?>',
@quangbahoa
quangbahoa / wordpress.vcl
Last active June 19, 2021 01:32 — forked from matthewjackowski/wordpress.vcl
Varnish 4 VCL configuration for WordPress. Also allows purging
# A heavily customized VCL to support WordPress
# Some items of note:
# Supports https
# Supports admin cookies for wp-admin
# Caches everything
# Support for custom error html page
vcl 4.0;
import directors;
import std;
server {
server_name www.cantwo.net;
rewrite ^(.*) http://cantwo.net$1 permanent;
}
server {
listen 80;
access_log off;
# access_log /home/cantwo.net/logs/access_log;
error_log off;
# error_log /home/cantwo.net/logs/error.log;