Skip to content

Instantly share code, notes, and snippets.

View jsonleex's full-sized avatar

leex jsonleex

View GitHub Profile
@jsonleex
jsonleex / navicat_premium_reset_trial.sh
Created May 8, 2024 00:22
Reset Navicat Premium 15/16 remaining trial days
#!/bin/bash
set -e
file=$(defaults read /Applications/Navicat\ Premium.app/Contents/Info.plist)
regex="CFBundleShortVersionString = \"([^\.]+)"
[[ $file =~ $regex ]]
version=${BASH_REMATCH[1]}
@jsonleex
jsonleex / onfire.js
Last active June 19, 2019 03:59
[发布-订阅模式] #Javascript #设计模式
export default class OnFire {
constructor() {
this.es = {};
}
on(evt, cb, once = false) {
if (!this.es[evt]) {
this.es[evt] = [];
}