Skip to content

Instantly share code, notes, and snippets.

@rming
rming / update_user_password_in_mysql_5.7.sql
Created February 23, 2020 13:03
update user password in mysql 5.7
UPDATE mysql.user
SET authentication_string = PASSWORD('root'), password_expired = 'N'
WHERE User = 'root' AND Host = '127.0.0.1';
FLUSH PRIVILEGES;
@rming
rming / Storage.js
Created May 27, 2020 00:27
微信 Storage 封装,支持过期时间
class Storage {
constructor(wx) {
this.wx = wx;
}
static get timestamp() {
return new Date() / 1000;
}
static __isExpired(entity) {
if (!entity) return true;
@rming
rming / cargo_x86_64-unknown-linux-gnu-on-m1-mac.sh
Created October 27, 2023 07:14 — forked from shqld/cargo_x86_64-unknown-linux-gnu-on-m1-mac.sh
cargo build for the target x86_64-unknown-linux-gnu on M1 Mac
# https://github.com/messense/homebrew-macos-cross-toolchains
brew tap messense/macos-cross-toolchains
brew install x86_64-unknown-linux-gnu
export CC_X86_64_UNKNOWN_LINUX_GNU=x86_64-unknown-linux-gnu-gcc
export CXX_X86_64_UNKNOWN_LINUX_GNU=x86_64-unknown-linux-gnu-g++
export AR_X86_64_UNKNOWN_LINUX_GNU=x86_64-unknown-linux-gnu-ar
export CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=x86_64-unknown-linux-gnu-gcc