Skip to content

Instantly share code, notes, and snippets.

@yogoeasy
yogoeasy / woocommerce-price-localization-01.css
Created March 25, 2017 08:59
WooCommerce將金額設置成「100元」
/*-- 隱藏原本金額前面的NT$ --*/
.woocommerce-Price-currencySymbol {
display: none;
}
/*-- 增加「元」這個字到金額後面 --*/
span.woocommerce-Price-amount.amount::after {
content: '元';
}
@yogoeasy
yogoeasy / woocommerce-price-localization-02.css
Created March 25, 2017 09:07
WooCommerce將金額設置成「$100」
/*-- 隱藏原本金額前面的NT$ --*/
.woocommerce-Price-currencySymbol {
display: none;
}
/*-- 增加「$」這個符號到金額前面 --*/
span.woocommerce-Price-amount.amount::before {
content: '$';
}
@yogoeasy
yogoeasy / button-add-to-cart-text-change.js
Created March 28, 2017 02:54
更換WooCommerce放入購物車按鈕文字
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery(".button-add-to-cart").text('放入購物車');
});
</script>
@yogoeasy
yogoeasy / divi-form-submit-text.js
Created April 11, 2017 09:44
修改Divi主題連絡表單送出按鈕的文字
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery("button.et_pb_contact_submit").text('送出');
});
</script>
@yogoeasy
yogoeasy / woocommerce-store-notice-fixed.css
Created April 12, 2017 10:57
WooCommerce 3.0 商店通知固定CSS
.woocommerce-store-notice, p.demo_store {
position: fixed !important;
}
@yogoeasy
yogoeasy / showmodule-shortcode.php
Last active May 17, 2017 02:24
將Divi Library的模組用shortcode的方式插入文章
<?php
/* 將Divi Library的模組用shortcode的方式插入文章 */
function showmodule_shortcode($moduleid) {
extract(shortcode_atts(array('id' =>'*'),$moduleid));
return do_shortcode('[et_pb_section global_module="'.$id.'"][/et_pb_section]');
}
add_shortcode('showmodule', 'showmodule_shortcode');
//by 優易教學網 https://www.yogoeasy.com
@yogoeasy
yogoeasy / subdomain.sh
Last active September 12, 2018 15:37
解決easyengine申請子網域Let's Encrypt SSL時卡住不動的問題
echo "**********************************************"
echo "Get Let's Encrypt by myself without EasyEngine"
echo "**********************************************"
read -p "Enter domain: " domain
/opt/letsencrypt/letsencrypt-auto certonly --agree-tos --email yourname@gmail.com --webroot -w /var/www/$domain/htdocs -d $domain
# by https://www.yogoeasy.com
@yogoeasy
yogoeasy / 手動安裝LetsEncrypt.sh
Last active June 20, 2018 03:43
手動安裝Let's Encrypt
#優易教學網 https://www.yogoeasy.com
#1.下載Let's encrypt
sudo apt-get update
sudo apt-get install git
sudo git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt
----------------------------------------------------------------------------------------
#2. 申請證書 Root Domain (subdomain刪掉後面的-d www.$domain)
#網站根目錄資料夾請按照實際狀況填寫
@yogoeasy
yogoeasy / web2-auto-reboot.log
Created July 4, 2018 01:21
WEB 自動重啟紀錄
Jul 3 09:12:36 web2 kernel: [ 0.000000] Linux version 4.15.0-24-generic (buildd@lgw01-amd64-056) (gcc version 7.3.0 (Ubuntu 7.3.0-16ubuntu3)) #26-Ubuntu SMP Wed Jun 13 08:44:47 UTC 2018 (Ubuntu 4.15.0-24.26-generic 4.15.18)
Jul 3 09:14:55 web2 kernel: [ 0.000000] Linux version 4.15.0-24-generic (buildd@lgw01-amd64-056) (gcc version 7.3.0 (Ubuntu 7.3.0-16ubuntu3)) #26-Ubuntu SMP Wed Jun 13 08:44:47 UTC 2018 (Ubuntu 4.15.0-24.26-generic 4.15.18)
Jul 3 12:28:18 web2 kernel: [ 0.000000] Linux version 4.15.0-24-generic (buildd@lgw01-amd64-056) (gcc version 7.3.0 (Ubuntu 7.3.0-16ubuntu3)) #26-Ubuntu SMP Wed Jun 13 08:44:47 UTC 2018 (Ubuntu 4.15.0-24.26-generic 4.15.18)
Jul 3 12:34:38 web2 kernel: [ 0.000000] Linux version 4.15.0-24-generic (buildd@lgw01-amd64-056) (gcc version 7.3.0 (Ubuntu 7.3.0-16ubuntu3)) #26-Ubuntu SMP Wed Jun 13 08:44:47 UTC 2018 (Ubuntu 4.15.0-24.26-generic 4.15.18)
Jul 3 15:25:21 web2 kernel: [ 0.000000] Linux version 4.15.0-24-generic (buildd@lgw01-amd64-056) (gcc versio
@yogoeasy
yogoeasy / to-do-after-RunCloud-installation.sh
Last active November 28, 2018 03:02
裝完RunCloud之後做的事[優易教學網]
# by Jack Wu 優易教學網 https://www.yogoeasy.com
# set date
echo "********************************************"
echo "set date"
echo "********************************************"
timedatectl set-timezone Asia/Taipei
#root SSH key
mkdir /root/.ssh
wget https://www.dropbox.com/s/用你自己的/id_rsa.pub --no-check-certificate