Skip to content

Instantly share code, notes, and snippets.

View MikeZLin's full-sized avatar

Michael Lin MikeZLin

  • London, United Kingdom
View GitHub Profile
@MikeZLin
MikeZLin / vscode.settings
Created January 6, 2022 08:52
vscode config
{
"editor.fontFamily": "'JetBrainsMonoNerdFontComplete-ExtraLight','JetBrains Mono ExtraLight','JetBrains Mono', 'Fira Code, Light',Monaco",
"editor.fontLigatures": true,
"editor.renderWhitespace": "all",
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"workbench.iconTheme": "vscode-icons",
"python.pythonPath": "/usr/bin/python3",
"touchBar.closeOtherEditors": false,
"touchBar.goToReferences": true,
@MikeZLin
MikeZLin / NewDateWithZone.go
Created January 23, 2020 23:52
New Go Time with old timezone
func newDateWithZoneDate(year int, month time.Month, day, hour, min, sec, nsec int, refTime time.Time) time.Time {
timeDiff := time.Duration(hour-refTime.Hour())*time.Hour +
time.Duration(min-refTime.Minute())*time.Minute +
time.Duration(sec-refTime.Second())*time.Second +
time.Duration(nsec-refTime.Nanosecond())*time.Nanosecond
return refTime.AddDate(year-refTime.Year(), int(month-refTime.Month()), day-refTime.Date()).
Add(timeDiff)
}
@MikeZLin
MikeZLin / lda_patch.patch
Created March 2, 2019 19:15
patch LDA for CPP11 Compile
diff --git a/include/ldaplusplus/events/Events.hpp b/include/ldaplusplus/events/Events.hpp
index bcaa96b..7126964 100644
--- a/include/ldaplusplus/events/Events.hpp
+++ b/include/ldaplusplus/events/Events.hpp
@@ -7,7 +7,7 @@
#include <mutex>
#include <thread>
#include <unordered_set>
-
+#include <functional>
@MikeZLin
MikeZLin / docx2pdf.py
Last active July 4, 2018 13:23 — forked from MichalZalecki/docx2pdf.py
Converting DOCX to PDF using Python
import sys
import subprocess
import re
def convert_to(folder, source, timeout=None):
args = [libreoffice_exec(), '--headless', '--convert-to', 'pdf', '--outdir', folder, source]
shell_str = ''
for i in args: