Skip to content

Instantly share code, notes, and snippets.

Avatar
👨‍💻
Debugging

Thien Nguyen tatthien

👨‍💻
Debugging
View GitHub Profile
@tatthien
tatthien / README.md
Created Oct 30, 2015 — forked from oodavid/README.md
Deploy your site with git
View README.md

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
    • apache's home directory is /var/www/
@tatthien
tatthien / FB Locale List
Created Nov 12, 2015 — forked from mechastorm/FB Locale List
List of locales supported by Facebook. These are the same supported locales that you can only call when loading the FB JS SDK
View FB Locale List
<?php
/**
* List of locales supported by Facebook.
*
* These are the same supported locales that you can only call when loading the FB JS SDK at
* //connect.facebook.net/{LOCALE_ID}/all.js
*
* Locales taken from http://www.facebook.com/translations/FacebookLocales.xml
*
* Last Updated: 04/09/2012
@tatthien
tatthien / js
Created Apr 19, 2016
Common Gulp Task
View js
var gulp
@tatthien
tatthien / gulpfile.js
Last active Apr 22, 2016
Common Gulp Tasks
View gulpfile.js
var gulp = require('gulp');
var sass = require('gulp-sass');
var minifyCSS = require('gulp-minify-css');
var concat = require('gulp-concat');
var rename = require('gulp-rename');
var uglify = require('gulp-uglify');
/**
* Basic gulp
*/
gulp.task('task-name', function() {
@tatthien
tatthien / html-todo-app-with-vue-js-blog-turorial.markdown
Created Mar 3, 2017
[HTML] Todo App with Vue.js - Blog turorial
View html-todo-app-with-vue-js-blog-turorial.markdown
@tatthien
tatthien / mje-render-payment-name.php
Last active Mar 23, 2017
MjE - Render Payment Name
View mje-render-payment-name.php
// Note: this's an example code of Stripe
// put your code into the functions.php of child-theme
// payment_name['stripe'] -> it maybe a 'stripe', 'paypal', 'cash'...
if( !function_exists( 'mje_stripe_render_payment_name' ) ) {
/**
* Filter payment name
*
* @param array $payment_name
* @return array $payment_name
* @since 1.0.0
View stripe-render-button.php
function mje_stripe_custom_render_button() {
if( MJE_Stripe::is_active() ) :
$disable_class = '';
$tooltip = '';
if( ! MJE_Stripe::is_has_api_key() ) {
$disable_class = 'disable-gateway';
$tooltip = 'data-toggle="tooltip" data-placement="top" data-original-title="' . __( 'You can not use this checkout method because of missing API key.' ) . '"';
}
?>
<li>
@tatthien
tatthien / heartbeat-send-client.js
Last active Apr 11, 2017
WordPress heartbeat client
View heartbeat-send-client.js
jQuery( document ).on( 'heartbeat-send', function ( event, data ) {
// Thêm dữ liệu cần gởi
data.message = 'Hello Server!';
});
@tatthien
tatthien / bible-button.php
Created Apr 12, 2017
Custom Bible Button
View bible-button.php
<?php
/*
Plugin Name: Custom Bible Button
Plugin URI: https://tatthien.com
Description: Add custom media button
Version: 1.0.0
Author: Tat Thien
Author URI: https://tatthien.com
License: A "Slug" license name e.g. GPL2
Text Domain: text_domain
You can’t perform that action at this time.