Skip to content

Instantly share code, notes, and snippets.

View tqcenglish's full-sized avatar
🎯
Focusing

tqcenglish tqcenglish

🎯
Focusing
View GitHub Profile
@tqcenglish
tqcenglish / Activate Office 2019 for macOS VoL.md
Created March 16, 2023 14:51 — forked from zthxxx/Activate Office 2019 for macOS VoL.md
crack activate office on mac with license file

Activate MS Office 2019/2016 for macOS - Microsoft_Office_2019_VL_Serializer

Office 2019 above

2019-06-03

Note that Office2019 DO NOT support activate via simple copy/paste plist license file which is the simplest way to activate Office 2016. Fortunately, you can also use the VL Serializer tool, just install Office 2019 and Serializer, then run Serializer to activate.

Ref

package main
import (
"bytes"
"encoding/binary"
"fmt"
)
//IntToBytes 256 => [0 0 0 0 0 0 1 0]
func IntToBytes(n int) []byte {
@tqcenglish
tqcenglish / single.go
Last active March 16, 2020 12:35
go 单例模式
//https://studygolang.com/articles/11444
type singleton struct{}
var ins *singleton
var once sync.Once
func GetIns() *singleton {
once.Do(func(){
ins = &singleton{}
})
return ins
}
@tqcenglish
tqcenglish / ajax.js
Created April 23, 2018 05:37
ajax 设置请求头
$.ajaxSetup({
beforeSend: (xhr) => {
xhr.setRequestHeader('Authorization', 'Basic YWRtaW46YWRtaW4=');
}
});
@tqcenglish
tqcenglish / go.go
Created June 5, 2017 03:05
go语言string、int、int64互相转换
#string到int
int,err:=strconv.Atoi(string)
#string到int64
int64, err := strconv.ParseInt(string, 10, 64)
#int到string
string:=strconv.Itoa(int)
#int64到string
string:=strconv.FormatInt(int64,10)
@tqcenglish
tqcenglish / PrintJSON.go
Last active October 18, 2019 07:05
遍历 map[string]interface{} 类型
package main
import "fmt"
// PrintJSON 遍历 map[string]interface{} 类型
func PrintJSON(m map[string]interface{}) {
for k, v := range m {
switch vv := v.(type) {
case string:
fmt.Println(k, "is string", vv)
@tqcenglish
tqcenglish / isNull.js
Last active November 11, 2016 03:48
判断变量 null
// 判断变量 undefined
var exp = undefined;
if (typeof (exp) == "undefined") {
alert("undefined");
}
// 判断变量 null
var exp = null;
if (!exp && typeof (exp) != "undefined" && exp != 0) {
alert("is null");
@tqcenglish
tqcenglish / ChineseCharToEn.java
Last active January 15, 2021 12:07
Java汉字拼音首字母提取
package com.zycoo.android.sip.util;
import java.io.UnsupportedEncodingException;
/**
* 取得给定汉字串的首字母串,即声母串 Title: ChineseCharToEn
*
* {@link http://blog.csdn.net/fei1502816/article/details/8446049}
*
* @date 2004-02-19 注:只支持GB2312字符集中的汉字
@tqcenglish
tqcenglish / singleton.java
Last active November 11, 2016 03:51
设计模式-单例
public class SingletonClass {
private static class SingletonClassInstance {
private static final SingletonClass instance = new SingletonClass();
}
public static SingletonClass getInstance() {
return SingletonClassInstance.instance;
}