Skip to content

Instantly share code, notes, and snippets.

View nguyenvanduocit's full-sized avatar
🌴
On vacation

Duoc Nguyen nguyenvanduocit

🌴
On vacation
View GitHub Profile
@nguyenvanduocit
nguyenvanduocit / ShortcutUtils.java
Created July 23, 2014 03:24
#android user to create shortcut on desktop
/*
* Copyright 2014 Uwe Trottmann
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@nguyenvanduocit
nguyenvanduocit / product_filter_menu.xml
Created July 23, 2014 06:53
#android #layout #menu Android Radio actionbar menu
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:bootstrap="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/menu_action_activity_filter"
android:icon="@drawable/ic_action_filter"
android:orderInCategory="2"
bootstrap:showAsAction="always"
android:title="@string/action_product_filter">
<group
/*
Make the Facebook Like box responsive (fluid width)
https://developers.facebook.com/docs/reference/plugins/like-box/
*/
/* This element holds injected scripts inside iframes that in some cases may stretch layouts. So, we're just hiding it. */
#fb-root {
display: none;
}
@nguyenvanduocit
nguyenvanduocit / selector.link.external.css
Created August 18, 2014 16:48
external link selector
.video-container {
position: relative;
padding-bottom: 56.25%;
padding-top: 30px;
height: 0;
overflow: hidden;
}
.video-container iframe,
.video-container object,
@nguyenvanduocit
nguyenvanduocit / functions.php
Created October 22, 2014 07:58
CE.add title, alt to image
function post_thumbnail_html ($html, $post_id, $post_thumbnail_id, $size, $attr) {
global $ce_config, $post;
// if($size !== '') return $html;
if( $post && $post->post_type !== 'ad' ) return $html;
$list_view = isset($_COOKIE['ce_list_view']) ? $_COOKIE['ce_list_view'] : $ce_config['default_grid'];
if(is_single()) {
$list_view = 'grid';
@nguyenvanduocit
nguyenvanduocit / Woocommerce.checkoutpage.customfield
Created October 31, 2014 08:39
[Woocommerce] Thêm Custom field vào trang checkout
add_action('init', 'ae_woocommerce_before_checkout_form');
function ae_woocommerce_before_checkout_form(){
add_filter( 'woocommerce_checkout_fields', 'ae_woocommerce_checkout_fields' );
}
function ae_woocommerce_checkout_fields($checkout_fields){
$checkout_fields['order']["new_comment"] = array(
'type' => 'textarea',
'class' => array('notes'),
@nguyenvanduocit
nguyenvanduocit / single-place-details.php
Created December 13, 2014 05:06
DirectoryEngine : Description auto fill all blank place
<?php
global $post, $ae_post_factory;
$place_obj = $ae_post_factory->get('place');
$place = $place_obj->current_post;
?>
<div class="section-detail-wrapper padding-top-bottom-20 print-only">
<div class="description-place-wrapper print-only">
<!--// place gallery -->
<div class="content-description">
<div class="info-address-place-wrapper">
@nguyenvanduocit
nguyenvanduocit / class-autoload.php
Last active August 29, 2015 14:14
Util class to autoload another class
<?php
if ( !class_exists( 'AEM_Autoload' ) ) {
/**
* Auto load core class and module class
*
* Class WFA_Autoload
* @author nguyenvanduocit
*/
@nguyenvanduocit
nguyenvanduocit / gist:0a33d5af657d7450986a
Created February 6, 2015 15:44
Writing WordPress Plugin Unit Tests
http://codesymphony.co/writing-wordpress-plugin-unit-tests