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 / 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.
#
@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 / 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;
<!-- 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 / 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
*/
@quangbahoa
quangbahoa / 000-default.conf
Created May 27, 2015 09:06
000-default.conf
<VirtualHost *:80>
ServerName getorganic.vn
ServerAdmin webmaster@localhost
DocumentRoot /home/getorganic.vn/public_html
<Directory "/home/getorganic.vn/public_html">
AllowOverride All
Require all granted
<?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 / wp-config-sample.php
Created May 3, 2015 08:01
Sample config file
<?php
/**
* The base configurations of the WordPress.
*
* This file has the following configurations: MySQL settings, Table Prefix,
* Secret Keys, and ABSPATH. You can find more information by visiting
* {@link https://codex.wordpress.org/Editing_wp-config.php Editing wp-config.php}
* Codex page. You can get the MySQL settings from your web host.
*
* This file is used by the wp-config.php creation script during the
@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)
@quangbahoa
quangbahoa / google-scripts.js
Last active August 29, 2015 14:20 — forked from duttajit50/sendsms
Send Google SMS
function sendsms()
{
try
{
var label = GmailApp.getUserLabelByName('sendsms');
var threads = label.getThreads();
var now = new Date().getTime();
var cal=getCalendar();
for(i in threads)