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
# Delete all evicted pods. | |
kubectl get po --all-namespaces --field-selector 'status.phase!=Running' -o yaml | kubectl delete -f - | |
# List all resources in a namespace. | |
kubectl api-resources --verbs=list --namespaced -o name | xargs -n 1 kubectl get --show-kind --ignore-not-found -n <namespace> | |
# Trigger cronjob manually. | |
kubectl create job --from=cronjob/<cronjob-name> <job-name> | |
# Run busybox. |
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
input = [ | |
50811, | |
128897, | |
89996, | |
149611, | |
141114, | |
135923, | |
111930, | |
92803, | |
55111, |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
</head> | |
<body> | |
<h1>Hello world</h1> | |
<div style="width: 100px; height: 100px; background-color: red"></div> | |
<h2>This is a header</h2> |
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
@asynccontextmanager | |
async def ws_connect_with_refresh( | |
session: ClientSession, | |
url: str, | |
interval: int, | |
loads: Callable[[str], Any], | |
take_until: Callable[[Any, Any], bool]) -> AsyncIterator[AsyncIterable[Any]]: | |
conn = session.ws_connect(url) | |
ws = await conn.__aenter__() |
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
kubectl get secret bigquery --namespace=default --export -o yaml | kubectl apply --namespace=monitoring -f - |
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 requests | |
assets = ['blockport', 'iota', 'bitcoin', 'litecoin', 'ethereum', 'bitcoin-cash', 'ripple', | |
'eos', 'neo', 'tron', 'aelf', 'monero'] | |
for asset in assets: | |
res = requests.get(f'https://api.coincap.io/v2/assets/{asset}/history?interval=d1') | |
res.text |
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 sys | |
inputs = [ | |
[ # High. | |
94.1875, 94.5000, 93.5000, 92.7500, 92.8750, 90.7500, 89.8750, 89.1250, 90.4375, | |
90.0000, 88.5000, 87.7500, 87.0625, 85.8125, 86.5625, 90.3750, 91.3750, 92.2500, | |
93.3750, 92.0625, 92.8750, 93.9375, 95.2500, 97.1250, 97.1875, 94.8750, 94.3125, | |
93.3125, 94.1250, 96.9375, 101.125, 108.750, 115.000, 117.125, 115.000, 116.625, | |
118.000, 119.250, 119.250, 118.812, 118.375, 119.938, 117.750, 118.625, 117.125, |
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
using static System.Diagnostics.Debug; | |
using static System.Math; | |
using Intervals = System.Collections.Generic.List<(int Start, int End)>; | |
namespace ConsoleApp2 | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Reactive.Disposables; | |
using System.Reactive.Linq; | |
using System.Threading.Tasks; | |
namespace Pronoodle.Products | |
{ | |
/// <summary> |
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
// Place your key bindings in this file to overwrite the defaults | |
[{ | |
"key": "ctrl+shift+t", | |
"command": "workbench.action.tasks.runTask", | |
"args": "cargo test", | |
"when": "editorTextFocus && editorLangId == rust" | |
},{ | |
"key": "ctrl+shift+r", | |
"command": "workbench.action.tasks.runTask", | |
"args": "cargo run", |