Skip to content

Instantly share code, notes, and snippets.

@zklhp
zklhp / Close-uselesstabs-in-163-mail.user.js
Last active November 10, 2021 12:35
Close useless tabs in 163 mail
// ==UserScript==
// @name Close useless tabs in 163 mail
// @namespace https://github.com/zklhp
// @icon https://mail.163.com/favicon.ico
// @version 3.3.0
// @description Close useless tabs
// @homepageURL https://gist.github.com/zklhp/c1a358f026358786bef58b49f65d8333
// @updateURL https://gist.github.com/zklhp/c1a358f026358786bef58b49f65d8333/raw/Close-uselesstabs-in-163-mail.user.js
// @author Chris Zheng <https://chriszheng.science/>
// @match *://mail.163.com/*
@zklhp
zklhp / xuexicn-study-automatically.user.js
Last active June 21, 2019 06:36
xuexi.cn study automatically UserScript
// ==UserScript==
// @name xuexi.cn study automatically
// @namespace https://github.com/zklhp
// @icon https://www.xuexi.cn/favicon.ico
// @version 1.1.7
// @homepageURL https://gist.github.com/zklhp/feddc94e4cf53d01091203413ec4e893
// @updateURL https://gist.github.com/zklhp/feddc94e4cf53d01091203413ec4e893/raw/xuexicn-study-automatically.user.js
// @description With this, you can view articles and videos automatically on xuexi.cn
// @author Chris Zheng <https://chriszheng.science/>
// @grant unsafeWindow
@liabru
liabru / save-file-local.js
Created April 24, 2014 17:46
Save a text file locally with a filename, by triggering a download in JavaScript
/*
* Save a text file locally with a filename by triggering a download
*/
var text = "hello world",
blob = new Blob([text], { type: 'text/plain' }),
anchor = document.createElement('a');
anchor.download = "hello.txt";
anchor.href = (window.webkitURL || window.URL).createObjectURL(blob);