Skip to content

Instantly share code, notes, and snippets.

View topmask's full-sized avatar
🤩
Out sick

Allen Smith topmask

🤩
Out sick
View GitHub Profile
@topmask
topmask / blockmetatwitter.md
Created June 26, 2023 06:15 — forked from dangovorenefekt/blockmetatwitter.md
Block Meta and Twitter (nginx)
@topmask
topmask / 以数字形式输入值
Last active June 26, 2022 07:33
以数字形式输入值
const numInput = document.getElementById('num-input');
let num;
// Bad: parseFloat() converts the string to a number
num = parseFloat(numInput.value);
// Good: returns a numeric value
num = numInput.valueAsNumber;
@topmask
topmask / 将HTTP协议重定向到HTTPS协议
Created June 26, 2022 07:30
将HTTP协议重定向到HTTPS协议
const httpsRedirect = () => {
if (location.protocol !== 'https:')
location.replace('https://' + location.href.split('//')[1]);
};
httpsRedirect();
// Redirect from http://mydomain.com to https://mydomain.com

Single-host Minio Setup

Docker-Compose single-host Minio S3 setup using Traefik (Let's Encrypt with DNS-01 challenge via Cloudflare) for TLS offloading.

Tested on Ubuntu 20.04.

Host Prerequisites

Run all commands shown here with root or prepend a sudo to the regarding commands which require higher privileges.

Install Docker

@topmask
topmask / email-template-sample.html
Created June 6, 2022 02:51 — forked from neicore/email-template-sample.html
Email Template Sample for the article "Our experience in creating HTML email templates"
<html style=" color-scheme: light dark; supported-color-schemes: light dark;">
<head>
<meta name="viewport" content="width=device-width" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet" />
<link href="https://unpkg.com/ionicons@4.5.5/dist/css/ionicons.min.css" rel="stylesheet" />
<title>Successful Deposit</title>
<meta name="color-scheme" content="light dark" />
<meta name="supported-color-schemes" content="light dark" />
@topmask
topmask / tz.php
Created December 21, 2021 05:01
探针
<?php
// error_reporting(0);
function __($message) {
$messages = array(
'Download' => '文件下载',
'Gateway' => '网关管理',
'Log Analysis' => '日志分析',
'Monitor' => '性能监控',
@topmask
topmask / www-post-thumb.php
Created November 16, 2021 11:48 — forked from gmazzap/www-post-thumb.php
WordPress plugin that allow to use an external image url as featured image.
<?php namespace GM\WWWPostThumbnail;
/**
* Plugin Name: WWW Post Thumbnail
* Description: Allow to use an external image url as featured image.
* Plugin URI: https://gist.github.com/Giuseppe-Mazzapica/928bc22e5f49a654cf7c
* Author: Giuseppe Mazzapica
* Author URI: https://github.com/Giuseppe-Mazzapica
* License: MIT
* Version: 0.1.0
*
@topmask
topmask / disable-woocommerce-bloat.php
Created October 30, 2021 10:31 — forked from tdmrhn/disable-woocommerce-bloat.php
Disable WooCommerce Bloat
<?php
add_filter( 'woocommerce_admin_disabled', '__return_true' );
add_filter( 'jetpack_just_in_time_msgs', '__return_false', 20 );
add_filter( 'jetpack_show_promotions', '__return_false', 20 );
add_filter( 'woocommerce_allow_marketplace_suggestions', '__return_false', 999 );
add_filter( 'woocommerce_helper_suppress_admin_notices', '__return_true' );
add_filter( 'woocommerce_marketing_menu_items', '__return_empty_array' );
add_filter( 'woocommerce_background_image_regeneration', '__return_false' );
add_filter( 'wp_lazy_loading_enabled', '__return_false' );
add_filter( 'woocommerce_menu_order_count', 'false' );
@topmask
topmask / product_key_features.php
Created October 30, 2021 10:18 — forked from tdmrhn/product_key_features.php
Product Key Features Field
<?php
// Display Input Field on Backend
add_action( 'woocommerce_product_options_general_product_data', function () {
global $woocommerce, $post;
echo '<div class="options_group">';
woocommerce_wp_text_input(
array(
'id' => 'product_key_features',
'label' => __( 'Product Key Features', 'woocommerce' ),
'placeholder' => 'Enter product key features (3 words)',
$mail->SMTPOptions = array(
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
)
);