Skip to content

Instantly share code, notes, and snippets.

View iamspark1e's full-sized avatar
🎶
The Real Folk Blues

Wenbo iamspark1e

🎶
The Real Folk Blues
View GitHub Profile
type WatermarkCanvasConfigurableOptions = {
textAlign?: string,
textBaseline?: string,
font?: string,
fillStyle?: string,
}
type WatermarkConfiguration = {
container: HTMLElement | null,
id: string,
@iamspark1e
iamspark1e / vue-stepper-with-unit.vue
Created November 30, 2023 08:03
My custom vue components
<template>
<div class="demo">
<button type="button" @click="minus" :disabled="value <= min">-</button>
<label>
<span v-show="!focused">{{ value }}{{ unit }}</span>
<input
type="number"
pattern="[0-9]*"
ref="realInput"
v-model.number="value"
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<!-- <script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script> -->
<script defer src="https://cdn.jsdelivr.net/npm/alpinejs@2.8.2/dist/alpine.min.js"></script>
</head>
// fit for concat html property
function escapeQuotes(raw, escape_double, escape_single) {
if(escape_double) raw = raw.replace(/"/g, "&quot;");
if(escape_single) raw = raw.replace(/'/g, "\'");
return raw;
}
package main
import (
"bytes"
"io"
"log"
"os"
"os/exec"
"strings"
import (
"fmt"
"net/http"
"os"
"strings"
"github.com/gin-gonic/gin"
"caddy-http-tls-provider/bootstrap"
"caddy-http-tls-provider/utils"
let status = false;
let iframeReq = () => {
return new Promise((resolve, reject) => {
let timeout = 10;
let counter = 0;
let timer = setInterval(() => {
if(!status) {
if(counter < timeout) {
counter++;
} else {
@iamspark1e
iamspark1e / pure-css-tabs.html
Created June 20, 2023 06:50
Pure CSS Tabs, forked from CodePen(https://codepen.io/markcaron/pen/MvGRYV), just in case lost.
<style>
/*
CSS for the main interaction
*/
.tabset > input[type="radio"] {
position: absolute;
left: -200vw;
}
.tabset .tab-panel {
## Office E5 mail
relayhost = [smtp.office365.com]:587
smtp_sasl_auth_enable = yes
smtp_sasl_security_options = noanonymous
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sender_dependent_authentication = yes
smtp_generic_maps = hash:/etc/postfix/generic
# STARTTLS in my case, this can solve SSL handshake error.
smtp_tls_security_level = may
# If your network cannot access IPv6.
import (
"crypto/tls"
"encoding/base64"
"fmt"
"log"
"net"
"net/smtp"
"strings"
)