Skip to content

Instantly share code, notes, and snippets.

View gozeon's full-sized avatar
🧑‍🍳
Ohooooooo~

Goze gozeon

🧑‍🍳
Ohooooooo~
View GitHub Profile
@gozeon
gozeon / go2shell_iTerm2.scpt
Created December 13, 2021 02:54
mac folder open path in iterm2
tell application "Finder"
set pathList to (quoted form of POSIX path of (folder of the front window as alias))
end tell
tell application "System Events"
if not (exists (processes where name is "iTerm2")) then
do shell script "open -a iTerm " & pathList
else
tell application "iTerm"
if (count of windows) is 0 then
@gozeon
gozeon / debounce.js
Last active August 2, 2023 03:40
Debounce & Throttle
function debounce(fn, delay) {
var timer;
return function() {
var _this = this;
var args = arguments;
if(timer) {
clearTimeout(timer)
}
timer = setTimeout(function() {
@gozeon
gozeon / apply.js
Last active May 28, 2021 02:23
bind(), call() and apply()
var user = {
name: 'Ryan',
getName: function() {
return this.name;
}
}
function displayInfo(greeting, greet2) {
console.log( greeting + ' ' + greet2 +' ' + this.getName() +"?");
}
@gozeon
gozeon / Activate Office 2019 for macOS VoL.md
Created October 8, 2020 11:20 — 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

@gozeon
gozeon / index.html
Created July 13, 2020 06:33
Monaco Editor CDN Demo
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Monaco Editor Demo</title>
<link href="https://cdn.bootcdn.net/ajax/libs/monaco-editor/0.20.0/min/vs/editor/editor.main.min.css" rel="stylesheet">
</head>
@gozeon
gozeon / index.html
Last active June 11, 2020 06:54
excel 模版
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<style>
* {
@gozeon
gozeon / insterLine.ts
Created March 27, 2020 09:12
inster line in file by ts
import { readFileSync, writeFileSync } from 'fs'
function appendLine(filePath: string, linenumber: number, line: string): Promise<void> {
return new Promise((resolve, reject) => {
try {
const data = readFileSync(filePath).toString().split("\n");
data.splice(linenumber, 0, line)
writeFileSync(filePath, data.join('\n'), 'utf8')
resolve()
} catch (e) {
@gozeon
gozeon / search.js
Created March 18, 2020 10:01
docsify search plugin
(function () {
/* eslint-disable no-unused-vars */
var INDEXS = {};
var LOCAL_STORAGE = {
EXPIRE_KEY: 'docsify.search.expires',
INDEX_KEY: 'docsify.search.index',
};
function resolveExpireKey(namespace) {
@gozeon
gozeon / intro-common.js
Created March 17, 2020 04:03
intro.js use
(function(key){
var doneTour = localStorage.getItem(key) === 'Completed';
if (doneTour) {
return;
}
var intro = introJs()
intro.start()
intro.oncomplete(function(){
localStorage.setItem(key, 'Completed');
})
@gozeon
gozeon / pre-commit.sh
Created November 19, 2019 02:52
git pre-commit hook
#!/bin/bash
# 将文件置于.git/hooks/下, 去掉.sh后缀,并修改权限为755
msg=$(head -n 1 $1)
# Merge
if echo $msg | grep -iqE "^Merge "; then
exit 0
fi;