Skip to content

Instantly share code, notes, and snippets.

View GHolk's full-sized avatar

Gold Holk GHolk

View GitHub Profile
@GHolk
GHolk / mathjs-eval-tag.js
Created November 25, 2018 04:21
this is a extension for mathjs, which allow you directly embed mathjs type variable in es6 tag template string.
/*
# mathjs es6 style tag template string
this is a extension for mathjs,
which allow you directly embed
mathjs type variable in es6 tag template string,
instead of pass variable by a dictionary object.
## usage
this script is useing commonjs style, use exports.
@GHolk
GHolk / double-click-not-click.user.js
Last active December 24, 2018 11:04
prevent double click being click
// ==UserScript==
// @name double click not click
// @namespace http://gholk.github.io/
// @description prevent double click being click
// @version 6
// @grant none
// ==/UserScript==
/*
when firefox on android use click then scroll to zoom,
@GHolk
GHolk / hackmd-scroll-flip.user.js
Created September 7, 2019 12:14
make mouse scroll flip page in hackmd slide mode.
// ==UserScript==
// @name hackmd scroll flip
// @namespace http://gholk.github.io/
// @version 6
// @description make mouse scroll flip page in hackmd slide mode.
// @match https://hackmd.io/*/*
// @grant none
// ==/UserScript==
if (document.querySelector('.reveal .slides')) {
#!/usr/bin/env python3
"""
write by gholk <gholk@ccns.ncku.edu.tw>
license under gpl3
"""
import glob
import os
import sys
import datetime
@GHolk
GHolk / element-show-mxc-reaction.user.js
Created June 15, 2021 04:03
show custom reaction in app.element.io, which has text content `mxc://*`
// ==UserScript==
// @name element show mxc reaction
// @namespace http://gholk.github.io/
// @version 2
// @match https://app.element.io/*
// @grant none
// ==/UserScript==
// license under gplv3 by gholk
// ==UserScript==
// @name google search unredirect
// @namespace http://gholk.github.io/
// @version 6
// @match https://www.google.com/search?*
// @grant none
// ==/UserScript==
function unlistenClick() {
for (const a of document.querySelectorAll('a[onmousedown]')) {
FUCK THE CCP 🇨🇳🇨🇳 💩💩💩
TAIWAN 🇹🇼 IS A COUNTRY 中華民國
Taiwan No.1 🇹🇼🇹🇼🇹🇼
🇭🇰 Liberate Hong Kong, 🇭🇰
🇭🇰 revolution of our times! 🇭🇰
FREE TIBET Dalai Lama 🏴󠁣󠁮󠀵󠀴󠁿🏴󠁣󠁮󠀵󠀴󠁿🏴󠁣󠁮󠀵󠀴󠁿
UYGHUR GENOCIDE
8964 TIANANMEN SQUARE MASSACRE
Tank man 占占点从从 天安門大屠殺
Commie Away 🖕☭🖕
@GHolk
GHolk / jscript-with-excel-ajax-fso.js
Last active October 13, 2022 00:46
A jscript use excel object model api, activex xmlhttp and filesystem object.
/* License under GPLv3 by gholk
*
* share for reference if anyone need to deal with excel object model in jscript/vbscript and other stuff.
*/
// import JSON
// # lookup code
var debugFlag = ''
@GHolk
GHolk / excel-merge-sheet.js
Last active November 4, 2022 03:22
merge all excel worksheets in workbook files into a new workbook with a single worksheet.
/**
* copyright: gholk 2022 (http://gholk.github.io/contact.html)
* license: gplv3
* install: copy this file to explorer.exe shell:sendto
* require: Excel.Application and wscript or cscript
* description: merge all excel worksheets in workbook files into a new workbook with a single worksheet.
* usage:
* - right click on xls(x) file(s) and select this script in send-to sub-menu
* - or run this script with cscript and pass xls files as arguments
* - or drag and drop files onto this script
var dlj=tri.downloadJob={browser:browser,os:"windows",downloadPath:"kwk",stop:false,ex:tri.excmds,idList:[],dlhandlerwrap(...args){return tri.downloadJob.dlhandler(...args)},dlhandler(){},async init(){const tab=await this.browser.tabs.query({active:true,currentWindow:true});this.tabId=tab[0].id;this.windowId=tab.windowId;return;this.dlhandle=function(e){const i=this.idList.findIndex(x=>x.id==e.id);if(i==-1)return;const job=this.idList[i];let state;if(typeof e.state=="object")state=e.state.current;else state=e.state;debugger;switch(e.state.current){case"complete":job.resolve();case"interrupted":let error=new Error("download fail");error.codeName="download-error";job.reject(error);this.idList.splice(i,1);default:true}};this.browser.downloads.onChanged.addListener(this.dlhandlerwrap);this.browser.downloads.onCreated.addListener(this.dlhandlerwrap)},destroy(){this.browser.downloads.onChanged.removeListener(this.dlhandlerwrap);this.browser.downloads.onCreated.removeListener(this.dlhandlerwrap)},async download(url,