A proxy app to reuse a web driver session during development. This reduces browswer launch time and let you run your script on the running session.
This file contains 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 json | |
import logging | |
import string | |
from itertools import zip_longest | |
from json.decoder import JSONDecodeError | |
from textwrap import dedent | |
from typing import ( | |
Awaitable, | |
Callable, | |
Iterable, |
This file contains 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 string | |
from itertools import zip_longest | |
from typing import Iterable, Optional | |
def hexdump(bs: bytes) -> str: | |
"""A pure python `hexdump -C` mimic | |
>>> print(hexdump(string.printable.encode('ascii'))) | |
000000000 30 31 32 33 34 35 36 37 38 39 61 62 63 64 65 66 |0123456789abcdef| | |
000000010 67 68 69 6a 6b 6c 6d 6e 6f 70 71 72 73 74 75 76 |ghijklmnopqrstuv| |
This file contains 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 SLACK::suppressor | |
// @version 0.1 | |
// @description Suppress annoying messages in muted channels | |
// @author You | |
// @match https://app.slack.com/client/* | |
// @connect slack.com | |
// @grant GM_xmlhttpRequest | |
// @grant GM_getValue | |
// @grant GM_setValue |
This file contains 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 Monitor-Zoom { | |
$stat = $fasle | |
while ($true) { | |
$cur = $(Get-CimInstance -ClassName Win32_Process -Filter 'name="CptHost.exe"').Length -gt 0 | |
if ($cur -eq $stat) { | |
# do nothing | |
} | |
elseif ($cur -and -not $stat) { | |
Invoke-WebRequest ` | |
-Method POST ` |
This file contains 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
/* ==UserStyle== | |
@name b.hatena.ne.jp | |
@namespace gist.github.com/pjxiao | |
@version 1.0.0 | |
@description Don't let b.hatena annoy me | |
@author pjxiao | |
==/UserStyle== */ | |
@-moz-document url-prefix("https://b.hatena.ne.jp/entry/") { | |
.entry-relationContents, |
TODO
This file contains 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
<script> | |
(function () { | |
const IGNORED_TAGS = ["SCRIPT", "STYLE"]; | |
// List all text nodes under the target elements | |
const nodes = []; | |
Array | |
.from(document.getElementsByClassName('ja')) | |
.forEach(function (root) { | |
const treeWalker = document.createTreeWalker(root, NodeFilter.SHOW_TEXT, null, false); |
This file contains 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
--- | |
# Reference: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.13/#persistentvolume-v1-core | |
apiVersion: v1 | |
kind: PersistentVolume | |
metadata: | |
name: pv-test-volume | |
spec: | |
storageClassName: dir | |
capacity: | |
storage: 256Mi |
This file contains 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
package main | |
import ( | |
"os" | |
"os/signal" | |
"log" | |
"context" | |
"github.com/urfave/cli" | |
// only for demonstration | |
"time" |
NewerOlder