Skip to content

Instantly share code, notes, and snippets.

View goyuninfo's full-sized avatar

goyun.info goyuninfo

View GitHub Profile
@goyuninfo
goyuninfo / Common pattern to visually hide text for only screen readers to read.css
Created May 1, 2023 20:37
To visually hide text for only screen readers to read, you can use the CSS .visuallyhidden class definition. This is a way to visually hide text content from sighted users, yet have the content remain available for screen reader users. This is also sometimes called sr-only, accessibility, or other related class names.
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border: 0;
@goyuninfo
goyuninfo / Common pattern to visually hide text for only screen readers to read
Last active May 1, 2023 20:34
To visually hide text for only screen readers to read, you can use the CSS.visuallyhidden class definition1. This is a way to visually hide text content from sighted users, yet have the content remain available for screen reader users. This is also sometimes called sr-only, accessibility, or other related class names.
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border: 0;
CEF
EPV
ERY
EUM
EWV
FAIL
FAZ
FLDR
FLMI
FLTB
@goyuninfo
goyuninfo / US-ETFs
Created June 17, 2022 01:12
ETF and CEF in US Market
AAA
AAAU
AADR
AAXJ
ABEQ
ACES
ACIO
ACP
ACSI
ACTV
import smtplib
import email.message, email.policy, email.utils, sys
text = """This is a test"""
message = email.message.EmailMessage(email.policy.SMTP)
message['To'] = 'noreply@goyun.info'
message['From'] = 'noreply@goyun.info'
message['Subject'] = 'A test email'
message['Date'] = email.utils.formatdate(localtime=True)
message['Message-ID'] = email.utils.make_msgid()
#!/bin/sh
#Alias of the certificate
echo 'Please enter the alias of the certificate: e.g. (shortwebname)'
read NAME
#The current domain registered in letsencrypt such as www.mydomain.com
echo 'Please enter the domain name: e.g. (www.mydomain.com)'
read DOMAIN
#The keystore password, default is (changeit)
echo 'Please enter the keystore password: default is (changeit)'
//Using read-only in a JPA Query
import org.eclipse.persistence.config.HintValues;
import org.eclipse.persistence.config.QueryHints;
query.setHint(QueryHints.READ_ONLY, HintValues.TRUE);
//Using read-only in a @QueryHint Annotation
import org.eclipse.persistence.config.HintValues;
import org.eclipse.persistence.config.QueryHints;
@QueryHint(name=QueryHints.READ_ONLY, value=HintValues.TRUE);
@goyuninfo
goyuninfo / VSCodeInstall.cmd
Created February 27, 2021 21:06
VSCode installer script
REM Download VSCode
curl -L "https://update.code.visualstudio.com/latest/win32-x64-user/stable" --output C:\Users\Public\Downloads\vscode.exe
REM Install and run VSCode
C:\Users\Public\Downloads\vscode.exe\vscode.exe /verysilent /suppressmsgboxes
mysql > SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
Query OK, 0 rows affected
Time: 0.001s
mysql > SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
Query OK, 0 rows affected
Time: 0.001s
mysql > SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
Query OK, 0 rows affected
Time: 0.001s
mysql > SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
@goyuninfo
goyuninfo / Install xfce on WSL2 Ubuntu.sh
Created February 24, 2021 00:37
Install xfce on WSL2 Ubuntu
sudo apt update && sudo apt -y upgrade
sudo apt-get purge xrdp
# install xfce
sudo apt-get install -y xfce4 xfce4-goodies
# install xrdp
sudo apt-get install xrdp
sudo cp /etc/xrdp/xrdp.ini /etc/xrdp/xrdp.ini.bak
sudo sed -i 's/3389/3390/g' /etc/xrdp/xrdp.ini
sudo sed -i 's/max_bpp=32/#max_bpp=32\nmax_bpp=128/g' /etc/xrdp/xrdp.ini
sudo sed -i 's/xserverbpp=24/#xserverbpp=24\nxserverbpp=128/g' /etc/xrdp/xrdp.ini