This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import contextlib | |
import gc | |
@contextlib.contextmanager | |
def disable_gc(): | |
if gc.isenabled(): | |
gc.disable() | |
yield | |
gc.enable() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param( | |
[Parameter(Position=0, mandatory=$true)] | |
[string] $Command, | |
[Parameter(Position=1, Mandatory=$false, ValueFromRemainingArguments=$true)] | |
[string[]] $CommandArgs | |
) | |
$PM_BASE_DIR = "$env:UserProfile\.pm" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param( | |
[Parameter(Position=0, mandatory=$true)] | |
[string] $Path | |
) | |
function RenameBak { | |
param ( | |
[string] $Path | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getGlobal() { | |
if (typeof globalThis !== 'undefined') { | |
return globalThis; | |
} else if (typeof window !== 'undefined') { | |
return window; // browser | |
} else if (typeof global != 'undefined') { | |
return global; // node | |
} else { | |
throw Error('unknown'); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# base-on https://zhuanlan.zhihu.com/p/104046487 | |
# clean patchs | |
Get-ChildItem -Path TCLS/patchs | Remove-Item | |
# clean Cross | |
Get-ChildItem -Path Cross | Where-Object -Property Name -NE -Value 'Apps' | Remove-Item –Recurse -Force | |
Get-ChildItem -Path Cross/Apps | Where-Object -Property Name -NE -Value 'Apps' | Remove-Item –Recurse -Force | |
# mark readonly. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# | |
# Copyright (c) 2020~2999 - Cologler <[email protected]> | |
# ---------- | |
# tinydb storage with atomic write. | |
# ---------- | |
import os | |
import json | |
from contextlib import suppress |