Skip to content

Instantly share code, notes, and snippets.

View jht5945's full-sized avatar
👣
Learning Rust, Dart and Go ...

Hatter Jiang jht5945

👣
Learning Rust, Dart and Go ...
View GitHub Profile
@jht5945
jht5945 / 806894FD.asc
Last active January 11, 2025 04:26
Hatter's OpenPGP keys: https://pgp.hatter.me/
-----BEGIN PGP PUBLIC KEY BLOCK-----
Comment: GPGTools - https://gpgtools.org
mDMEZR5gUhYJKwYBBAHaRw8BAQdA1XoIFEjG09YHaxzKAhbzGeRcwq2YZUHK8NPW
L1sxgmO0J0hhdHRlciBKaWFuZyAoMjAyMykgPGpodDU5NDVAZ21haWwuY29tPoiQ
BBMWCgA4AhsDBQsJCAcDBRUKCQgLBRYCAwEAAh4BAheAFiEEwPrV5WO4DoGWA7DZ
/8KpEIBolP0FAmUeY6IACgkQ/8KpEIBolP2h5QEAr6TxzCWferiUNJ89MguxOskG
XEs5SfNRh8EgNmD1tacBAPEVbr9KXCA2jmYEco1Ik+e6sNIEr+k/4sNCWuD99X4K
uDgEZR5gUhIKKwYBBAGXVQEFAQEHQH/rqrDYDO0kcwthPz2GkkVg688TqDjevAZf
Y8acJMYeAwEIB4h4BBgWCgAgFiEEwPrV5WO4DoGWA7DZ/8KpEIBolP0FAmUeYFIC
@jht5945
jht5945 / markdown-notes.md
Last active December 28, 2024 14:52
markdown-notes.md
> [!NOTE]  
> Highlights information that users should take into account, even when skimming.

> [!TIP]
> Optional information to help a user be more successful.

> [!IMPORTANT]  
> Crucial information necessary for users to succeed.
@jht5945
jht5945 / keybase.md
Created December 31, 2023 08:08
keybase.md

Keybase proof

I hereby claim:

  • I am jht5945 on github.
  • I am hatter (https://keybase.io/hatter) on keybase.
  • I have a public key whose fingerprint is 6FAF C0E0 1709 85AA 7154 5483 C794 B164 6A88 6CD6

To claim this, I am signing this object:

Simple Security Guidelines

  • Use an iDevice

    • Use an iPod or an iPad without a SIM card
    • Use an iPhone
    • Do not jailbreak
    • Always upgrade to new iOS versions
  • Use Signal (iOS + Android)

@jht5945
jht5945 / googleauth.go
Created July 19, 2015 10:05
TOTP in Go Lang implemention
package googleauth
/*
Use sample:
challenge := googleauth.GetChallenge()
currPasscode, err := googleauth.GenerateResponseCode(secret, challenge) // current passcode
nextPasscode, err := googleauth.GenerateResponseCode(secret, challenge + 1) // next passcode
*/
import (
@jht5945
jht5945 / gist:db4389d068a96c40ea6b
Created September 10, 2014 14:36
phishing issue
// jh***@gmail.com is my email address.
Delivered-To: jh***@gmail.com
Received: by 10.182.48.200 with SMTP id o8csp41105obn;
Fri, 5 Sep 2014 05:35:11 -0700 (PDT)
X-Received: by 10.152.21.168 with SMTP id w8mr11470156lae.53.1409920510262;
Fri, 05 Sep 2014 05:35:10 -0700 (PDT)
Return-Path: <boris0968@gagarin.timeweb.ru>
Received: from gagarin.timeweb.ru (gagarin.timeweb.ru. [92.53.96.221])
by mx.google.com with ESMTPS id rn2si2846435lbc.37.2014.09.05.05.35.07
for <jh***@gmail.com>
// refer:
// http://zh.wikibooks.org/wiki/Unicode/20000-20FFF
// http://dev.mysql.com/doc/refman/5.0/en/string-functions.html
// https://dev.mysql.com/doc/refman/5.5/en/charset-unicode-upgrading.html
mysql> create table test_x (value varchar(100)) default character set utf8mb4;
Query OK, 0 rows affected (0.04 sec)
mysql> insert into test_x values('𠀳');
Query OK, 1 rows affected, 1 warnings (0.01 sec)