Skip to content

Instantly share code, notes, and snippets.

View jsliang's full-sized avatar

Jui-Shan Liang (Jenny) jsliang

View GitHub Profile
@jsliang
jsliang / yearlyMoc.js
Last active February 13, 2024 12:22
Yearly MOC Generator - Obsidian Templater User Script
/**
* @author Jui-Shan (Jenny) Liang <jsliang.tw@gmail.com>
* @param {Object} tp the `tp` object of the Templater plugin
* @param {Object} options options for configuring the year to generate the MOC and the file name format
* @param {string} options.YEAR what year to generate the MOC; default to the current year
* @param {string} options.YEARLY_FORMAT filename format of yearly notes; format reference: https://momentjs.com/docs/#/displaying/format/
* @param {string} options.QUARTER_FORMAT filename format of quarterly notes; format reference: https://momentjs.com/docs/#/displaying/format/
* @param {string} options.MONTH_FORMAT filename format of monthly notes; format reference: https://momentjs.com/docs/#/displaying/format/
* @param {string} options.WEEK_FORMAT filename format of weekly notes; format reference: https://momentjs.com/docs/#/displaying/format/
* @param {string} options.DAY_FORMAT filename format of daily notes; format reference: https://momentjs.com/docs/#/displaying/format/
@jsliang
jsliang / broadlink_learn.py
Last active July 4, 2020 17:45
A script to learn IR code with Broadlink RM2/3 (Pro) remote controls using the mjg59/python-broadlink library
@jsliang
jsliang / cloudSettings
Last active November 9, 2021 09:22
Visual Studio Code Sync Settings GIST
{"lastUpload":"2021-11-09T09:22:22.035Z","extensionVersion":"v3.4.3"}
@jsliang
jsliang / prevent_drag_drop.js
Created January 23, 2015 07:11
preventing drag & drop disaster
// preventing drag & drop disaster
var preventDrag = function(e) {
e.stopPropagation();
e.preventDefault();
};
var preventDrop = function(e) {
if (e.dataTransfer.files.length > 0) {
e.stopPropagation();
e.preventDefault();
}