Skip to content

Instantly share code, notes, and snippets.

View thanh4890's full-sized avatar
🏠
Working from home

Thanh Nguyen Dac thanh4890

🏠
Working from home
View GitHub Profile
@thanh4890
thanh4890 / payjp_checkout.js
Last active November 11, 2019 10:06 — forked from mori-dev/payjp_checkout.js
PAY.JP の Checkout 用の React.js コンポーネント
// @flow
import React, { Component } from 'react'
import { findDOMNode } from 'react-dom'
class PayjpCheckout extends Component {
constructor(props: Object) {
super(props);
this.windowAlertBackUp = window.alert;
this.script = document.createElement('script');
@thanh4890
thanh4890 / sublime-command-line.md
Created July 17, 2018 04:12
Launch Sublime Text from the command line on OSX

Launch Sublime Text from the command line on OSX

Sublime Text includes a command line tool, subl, to work with files on the command line. This can be used to open files and projects in Sublime Text, as well working as an EDITOR for unix tools, such as git and subversion.

Requirements

  • Sublime text 2 or 3 installed in your system within Applications folder

Setup

@thanh4890
thanh4890 / config.rb
Created November 29, 2016 10:20 — forked from nathansmith/config.rb
Example config.rb file for Compass
preferred_syntax = :sass
http_path = '/'
css_dir = 'assets/stylesheets'
sass_dir = 'assets/sass'
images_dir = 'assets/images'
javascripts_dir = 'assets/javascripts'
relative_assets = true
line_comments = true
# output_style = :compressed
@thanh4890
thanh4890 / wc-empty-cart-notice.php
Created November 20, 2016 13:59 — forked from bekarice/wc-empty-cart-notice.php
WooCommerce: Show a notice throughout the store if the cart is empty
/**
* Tutorial: http://www.skyverge.com/blog/check-if-woocommerce-cart-is-empty/
**/
function skyverge_empty_cart_notice() {
if ( WC()->cart->get_cart_contents_count() == 0 ) {
wc_print_notice( __( 'Get free shipping if your order is over $60!', 'woocommerce' ), 'notice' );
// Change notice text as desired
}
@thanh4890
thanh4890 / gulpfile.js
Created April 6, 2016 01:10 — forked from mlouro/gulpfile.js
gulpfile.js with browserify, jshint, libsass, browserSync for livereload, image optimization and system notifications on errors
'use strict';
var gulp = require('gulp');
var gutil = require('gulp-util');
var del = require('del');
var uglify = require('gulp-uglify');
var gulpif = require('gulp-if');
var exec = require('child_process').exec;
var notify = require('gulp-notify');
// Options toggler hanlder
// To turn on/off other options base on toggler selection
function initOptionToggler() {
$(document).delegate('.yk-toggler', 'click', function(){
var toggler_name = $(this).attr("name").replace("option_tree[","").replace("]","");
var toggler_value = $(".yk-toggler[name*="+toggler_name+"]:checked").val();
// Turn off all .yk-toggle-able fields
$(".yk-toggle-able[class*="+toggler_name+"]").parents(".format-settings").slideUp();
add_filter( 'woocommerce_currencies', 'add_my_currency' );
function add_my_currency( $currencies ) {
$currencies['ABC'] = __( 'Currency name', 'woocommerce' );
return $currencies;
}
add_filter('woocommerce_currency_symbol', 'add_my_currency_symbol', 10, 2);
function add_my_currency_symbol( $currency_symbol, $currency ) {