Skip to content

Instantly share code, notes, and snippets.

# Generated by Powerlevel10k configuration wizard on 2025-04-01 at 03:12 CST.
# Based on romkatv/powerlevel10k/config/p10k-lean.zsh, checksum 37983.
# Wizard options: powerline, unicode, lean, 24h time, 1 line, compact, concise,
# instant_prompt=verbose.
# Type `p10k configure` to generate another config.
#
# Config for Powerlevel10k with lean prompt style. Type `p10k configure` to generate
# your own config based on it.
#
# Tip: Looking for a nice color? Here's a one-liner to print colormap.
@q0821
q0821 / LINE 加入好友連結.html
Created September 20, 2023 22:53
LINE 加入好友連結
https://line.me/R/ti/p/{LINE_id}
// returns the cookie with the given name,
// or undefined if not found
function getCookie(name) {
let matches = document.cookie.match(new RegExp(
"(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)"));
return matches ? decodeURIComponent(matches[1]) : undefined;
}
---
<img src="<?php echo wp_get_attachment_image_url( $attachment_id, 'medium' ) ?>"
srcset="<?php echo wp_get_attachment_image_srcset( $attachment_id, 'medium' ) ?>"
sizes="<?php echo wp_get_attachment_image_sizes( $attachment_id, 'medium' ) ?>" />
/* Box sizing rules */
*,
*::before,
*::after {
box-sizing: border-box;
}
/* Prevent font size inflation */
html {
-moz-text-size-adjust: none;
function wp_maintenance_mode() {
if (!current_user_can('edit_themes') || !is_user_logged_in()) {
wp_die('<h1>網站維護中</h1><br />網站維護中,請稍後再來,要停止維護模式請洽網站維護人員。');
}
}
add_action('get_header', 'wp_maintenance_mode');
add_action('admin_init', function () {
// Redirect any user trying to access comments page
global $pagenow;
if ($pagenow === 'edit-comments.php') {
wp_safe_redirect(admin_url());
exit;
}
// Remove comments metabox from dashboard
<link href="/templates/projectclub/css/fixed-btn-join.css?20230315-1" rel="stylesheet">
<div class="fixed-btn-container"><a class="fixed-btn-join" target="_blank" href="https://www.projectclub.com.tw/class/224-bigdatamap/individual-registration.html" id="fixed-btn-join">立即上課 NT$ 18,000</a></div>
<?php
// https: //www.cloudways.com/blog/create-woocommerce-custom-order-status/
function register_shipped_unpaid_order_status() {
register_post_status( 'wc-shipped-unpaid', array(
       'label'                     => '已完成未付款',
'public' => true,
'show_in_admin_status_list' => true,
'show_in_admin_all_list' => true,
'exclude_from_search' => false,