Skip to content

Instantly share code, notes, and snippets.

@Cologler
Cologler / StyleSwitcher.js
Last active January 15, 2018 15:09
StyleSwitcher is a easy way to change the css in greasemonkey.
// ==UserScript==
// @name StyleSwitcher
// @namespace https://github.com/cologler/
// @version 0.2.2
// @description try to take over the world!
// @author cologler
// @grant GM_addStyle
// @grant GM_getValue
// @grant GM_setValue
// @grant GM_info
@Cologler
Cologler / SingletonData.js
Last active January 15, 2018 15:08
SingletonData allow read write single data on mulit-tabs.
// ==UserScript==
// @name SingletonData
// @namespace https://github.com/cologler/
// @version 0.3
// @description try to take over the world!
// @author cologler
// @grant GM_getValue
// @grant GM_setValue
// @grant GM_addValueChangeListener
// @grant GM_removeValueChangeListener
@Cologler
Cologler / cologler.com.github.blocker.user.js
Last active January 3, 2018 05:35
#site:github #user_script
// ==UserScript==
// @name github-blocker
// @name:zh-CN github-blocker
// @namespace https://github.com/cologler/github-blocker
// @version 1.1.0.2
// @description block github user.
// @description:zh-CN 屏蔽某些国产 github 伸手党用户.
// @author cologler
// @match https://github.com/*/*
// @grant GM_setValue
@Cologler
Cologler / cologler.com.amazon.s3-images-gallery.user.js
Last active February 5, 2018 01:06
show images gallery on amazon s3 when your files is images. #user_script
@Cologler
Cologler / stringSearcherMap.js
Last active September 7, 2017 03:49
#javascript_lib #user_script_lib
// ==UserScript==
// @name StringSearcherMap
// @namespace https://github.com/cologler/
// @version 0.1
// @description try to take over the world!
// @author cologler
// @grant none
// ==/UserScript==
class StringSearcherMap {
@Cologler
Cologler / adder.py
Last active April 17, 2024 03:15
#user_script
# -*- coding: utf-8 -*-
#
# Copyright (c) 2020~2999 - Cologler <skyoflw@gmail.com>
# ----------
#
# ----------
import os
import sys
import traceback
@Cologler
Cologler / parseLinkHeader.js
Last active September 7, 2017 03:50
#javascript_lib
/* Copyright (c) 2017~2999 - cologler <skyoflw@gmail.com> */
function parseLinkHeader(link) {
let parts = link.match(/<([^ ]+)>; rel="([^"]+)"/g);
let r = {};
parts.forEach(p => {
let m = p.match(/<([^ ]+)>; rel="([^"]+)"/);
r[m[2]] = m[1];
});
return r;
}
@Cologler
Cologler / sortChildren.js
Created September 8, 2017 06:17
#javascript_lib
/**
* Copyright (c) 2017~2999 - cologler <skyoflw@gmail.com>
* @param {any} root
* @param {any} options
* */
function sortChildren(root, options) {
options = Object.assign({
filter: () => true,
selector: z => z,
comparer: (x, y) => x - y
@Cologler
Cologler / qs.js
Last active September 25, 2017 09:13
#user_script_lib
// ==UserScript==
// @name QS
// @namespace https://github.com/cologler/
// @version 0.1.6.1
// @description a helper for QuickSettings.
// @author cologler (skyoflw@gmail.com)
// @grant none
// @license MIT
// @require https://cdn.jsdelivr.net/quicksettings/latest/quicksettings.min.js
// ==/UserScript==
@Cologler
Cologler / pr.py
Last active June 26, 2018 00:07
format output from pipe.
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017~2999 - cologler <skyoflw@gmail.com>
# ----------
# format output from pipe.
# ----------
'''Usage:
python pr.py PATTERN