Skip to content

Instantly share code, notes, and snippets.

View GHolk's full-sized avatar

Gold Holk GHolk

View GitHub Profile
#!/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 / 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')) {
@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 / 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 / maze-connect.c
Last active November 3, 2018 11:19
determine two point in ascii maze is connect
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
#include <inttypes.h>
#define putsNoLn(string) fputs(string, stdout)
@GHolk
GHolk / monkey-hackmd-bookmode.user.js
Last active June 3, 2018 14:12
monkey patching bookmode for hackmd
// ==UserScript==
// @name monkey hackmd toc
// @namespace http://gholk.github.io
// @version 9
// @grant none
// @match https://hackmd.io/*
// @match https://hackmd.ccns.ncku.edu.tw/*
// ==/UserScript==
/* this script monkey patch the hackmd easy content table,
@GHolk
GHolk / flolac-prerequisites.hs
Created May 31, 2018 09:25
2018 年報名 flolac 所要求的課前測驗
-- 作者 gholk
-- 日期 2018-05-31
{- 2018 年報名 flolac 所要求的課前測驗,
昨天看完前三章,現在邊看第四章邊把測驗寫完了。 -}
-- 1
myFst :: (a,b) -> a
myFst (a,b) = a
@GHolk
GHolk / async.js
Last active May 22, 2018 12:59
wrap wrap wrap!
function patchGeneratorFunction() {
const GeneratorFunction = function *(){}.constructor
GeneratorFunction.prototype.asyncCallback = function () {
return CallbackAsync.fromGeneratorToCallback(this, ...arguments)
}
GeneratorFunction.prototype.asyncPromise = function () {
return PromiseAsync.fromGeneratorToPromise(this, ...arguments)
}
GeneratorFunction.prototype.async = GeneratorFunction.prototype.asyncPromise
@GHolk
GHolk / grease-monkey-repl.user.js
Last active May 6, 2018 09:02
read evaluate print loop of grease monkey environment
// ==UserScript==
// @name greasy monkey repl
// @description read evaluate print loop of grease monkey environment
// @namespace http://gholk.github.io/
// @version 4
// @match *
// @grant GM.info
// @grant GM.deleteValue
// @grant GM.getValue
// @grant GM.listValues
@GHolk
GHolk / bbsjs.user.js
Last active May 6, 2018 09:56
execute javascript in ptt chrome
// ==UserScript==
// @name chrome bbs javascript executor
// @namespace http://gholk.github.io/
// @description press J in term.ptt.cc can run JavaScript
// @match https://term.ptt.cc/*
// @match https://www.clam.ml/*
// @match https://www.ptt.cc/bbs/*
// @version 15
// @grant none
// ==/UserScript==