Skip to content

Instantly share code, notes, and snippets.

# git for fork.
param (
[string] $RepoUrl,
[string] $Dest
)
function Help {
Write-Host 'Git command for clone repo which not belong to you.'
Write-Host ' -> create dir with name ' -NoNewline
Write-Host '$host#$user#$repo' -ForegroundColor Green
@Cologler
Cologler / debug-route.js
Last active February 21, 2020 10:15
a script to debug rsshub route without run koa http server.
/*
* to use this script,
* 1. save debug-route.js to rsshub root dir.
* 2. try: node debug-route.js "/chrome/webstore/extensions/SOME_ID"
*/
const moduleAlias = require('module-alias');
moduleAlias.addAlias('@', () => __dirname + '/lib');
const util = require('util');
@Cologler
Cologler / bak.ps1
Last active February 21, 2020 15:13
a script that create a *.bak file for target file
param(
[Parameter(Position=0, mandatory=$true)]
[string] $Path
)
function RenameBak {
param (
[string] $Path
)
param(
[Parameter(Position=0, mandatory=$true)]
[string] $Command,
[Parameter(Position=1, Mandatory=$false, ValueFromRemainingArguments=$true)]
[string[]] $CommandArgs
)
$PM_BASE_DIR = "$env:UserProfile\.pm"
@Cologler
Cologler / code_timer.py
Last active May 12, 2019 12:30
code timer for python, base on timeit
import time
import contextlib
import gc
@contextlib.contextmanager
def disable_gc():
if gc.isenabled():
gc.disable()
yield
gc.enable()
@Cologler
Cologler / open-image-in-subview.user.js
Last active July 6, 2018 06:11
open image in a subview without redirect
// ==UserScript==
// @name open image in subview
// @namespace https://github.com/Cologler/
// @version 0.1
// @description open image in a subview without redirect.
// @author Cologler ([email protected])
// @noframes
// @license MIT
// @grant GM_addStyle
// @grant GM_getResourceText
@Cologler
Cologler / gist-raw-newest-button.user.js
Last active September 13, 2021 02:19
add 'Raw (Newest)' button to gist.
// ==UserScript==
// @name gist: Raw (Newest) button
// @namespace https://github.com/cologler/
// @version 0.2.0
// @description add 'Raw (Newest)' button to gist.
// @author Cologler
// @match https://gist.github.com/*/*
// @connect gist.githubusercontent.com
// @noframes
// @license MIT
@Cologler
Cologler / pr.py
Last active June 26, 2018 00:07
format output from pipe.
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017~2999 - cologler <[email protected]>
# ----------
# format output from pipe.
# ----------
'''Usage:
python pr.py PATTERN
@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 ([email protected])
// @grant none
// @license MIT
// @require https://cdn.jsdelivr.net/quicksettings/latest/quicksettings.min.js
// ==/UserScript==
@Cologler
Cologler / sortChildren.js
Created September 8, 2017 06:17
#javascript_lib
/**
* Copyright (c) 2017~2999 - cologler <[email protected]>
* @param {any} root
* @param {any} options
* */
function sortChildren(root, options) {
options = Object.assign({
filter: () => true,
selector: z => z,
comparer: (x, y) => x - y