Skip to content

Instantly share code, notes, and snippets.

@vinacode
vinacode / demo.txt
Created October 3, 2012 03:11
first gist demo
test ok
| Test Case# | Test Title | Test Summary | Test Steps | Test Data | Expected Result | Post-condition | Actual Result | Status | Notes |
|------------|-----------------------|---------------------------------------------------------------|--------------------------------------------------------------------------------------------------------|------------|-----------------------------------------------------------------------------------------------|----------------|-----------------------------------------------------------------------------------------------|--------|-------|
| 1 | Text label | Confirm all text label in screen is corrects with design |
@vinacode
vinacode / style.css
Created June 27, 2014 04:00
re-style child theme
/*
Theme Name: Quang Huc Corporation theme
Theme URI: http://htxquanghuc.com
Description: A child theme for the Customizr WordPress theme. This child theme simply includes 2 files : style.css to add your custom css and functions.php where you can extend Customizr's core code. In order to keep your code as clean and flexible as possible, try to use Customizr's hooks API for your customizations. Do something awesome and have fun !
Author: Duan Le
Author URI: http://htxquanghuc.com
Template: customizr
Version: 1.0.0
*/
@vinacode
vinacode / style.css
Created July 1, 2014 02:31
Customizr-style.css
/*
Theme Name: Quang Huc Corporation theme
Theme URI: http://htxquanghuc.com
Description: A child theme for the Customizr WordPress theme. This child theme simply includes 2 files : style.css to add your custom css and functions.php where you can extend Customizr's core code. In order to keep your code as clean and flexible as possible, try to use Customizr's hooks API for your customizations. Do something awesome and have fun !
Author: Duan Le
Author URI: http://htxquanghuc.com
Template: customizr
Version: 1.0.0
*/
@vinacode
vinacode / customer-processing-order.php
Created July 1, 2014 10:05
WooCommerce email template
<?php
/**
* Customer processing order email
*
* @author WooThemes
* @package WooCommerce/Templates/Emails
* @version 1.6.4
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly ?>
@vinacode
vinacode / wpRemoveScriptVer.php
Created July 4, 2014 02:31
Wordpress remove version param from scripts
<?php
/**================Remove wp version param from any enqueued scripts===================**/
function _remove_script_version( $src ){
$parts = explode( '?ver', $src );
return $parts[0];
}
add_filter( 'script_loader_src', '_remove_script_version', 15, 1 );
add_filter( 'style_loader_src', '_remove_script_version', 15, 1 );
@vinacode
vinacode / wpGoogleJqueryAPIReplace.php
Created July 4, 2014 02:34
Wordpress replace jquery default with Google API CDN jquery
<?php
/**================Making jQuery Google API===================**/
function use_google_api_jquery() {
if (!is_admin()) {
// comment out the next two lines to load the local copy of jQuery
wp_deregister_script('jquery');
wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js', false);
wp_enqueue_script('jquery');
}
}
@vinacode
vinacode / wpCustomUploadsUrl.php
Created July 4, 2014 02:48
Wordpress customize upload media directory
<?php
/**================Customize upload dir url===================**/
function my_custom_medias_dir( $pathdata ) {
$subdir = '/medias'.$pathdata['subdir'];
$pathdata['path'] = str_replace($pathdata['subdir'], $subdir, $pathdata['path']);
$pathdata['url'] = str_replace($pathdata['subdir'], $subdir, $pathdata['url']);
$pathdata['subdir'] = str_replace($pathdata['subdir'], $subdir, $pathdata['subdir']);
return $pathdata;
}
@vinacode
vinacode / woocommerce_price_with_weight.php
Created July 4, 2014 04:43
WooCommerce add weight unit after price filter
<?php
/**================WooCommerce weight unit after price===================**/
add_filter( 'woocommerce_price_html', 'woocommerce_custom_sales_price', 10, 2 );
add_filter( 'woocommerce_sale_price_html', 'woocommerce_custom_sales_price', 10, 2 );
function woocommerce_custom_sales_price( $price, $product ) {
return sprintf( __( '%s/kg', 'woocommerce' ), $price );
}
@vinacode
vinacode / cakephp24_bootstrap3_pagination.ctp
Last active August 29, 2015 14:06
CakePHP 2.4.x with Bootstrap 3 and Pagination
<div class="row">
<?php foreach ($products as $product):?>
<div class="col-lg-3 col-md-4 col-sm-6 col-xs-12">
<?php echo $this->Html->link($this->Html->image($product['Product']['image']),
array('action'=>'view',$product['Product']['id']),
array('escape'=>false,'class'=>'thumbnail'));?>
<div class="caption">
<h5>
<?php echo $product['Product']['name'];?>
</h5>