Skip to content

Instantly share code, notes, and snippets.

View kovetskiy's full-sized avatar
🏊

Egor Kovetskiy kovetskiy

🏊
View GitHub Profile
0 is not stdin on windows
#7 started for future.
ability to kill sudo background process
a bit of refactoring, minor improvements
A breath of fresh air
accept arbitrary size tokens
accept arbitrary types as nested error
Account for DataCenter mode while looking for hook scripts
Activity reviewing is now avaiable
actually, clear status on exit
@kovetskiy
kovetskiy / main.js
Created June 4, 2020 13:28 — forked from kdzwinel/main.js
List all undefined CSS classes
/*
This script attempts to identify all CSS classes mentioned in HTML but not defined in the stylesheets.
In order to use it, just run it in the DevTools console (or add it to DevTools Snippets and run it from there).
Note that this script requires browser to support `fetch` and some ES6 features (fat arrow, Promises, Array.from, Set). You can transpile it to ES5 here: https://babeljs.io/repl/ .
Known limitations:
- it won't be able to take into account some external stylesheets (if CORS isn't set up)
- it will produce false negatives for classes that are mentioned in the comments.
#!/bin/bash
###
### my-script — does one thing well
###
### Usage:
### my-script <input> <output>
###
### Options:
### <input> Input file to read.
### <output> Output file to write. Use '-' for stdout.
@kovetskiy
kovetskiy / main.go
Created November 18, 2020 18:34
Go get stacktrace
func getStack(skip int) string {
buffer := make([]byte, 1024)
for {
written := runtime.Stack(buffer, false)
if written < len(buffer) {
// call stack contains of goroutine number and set of calls
// goroutine NN [running]:
// github.com/user/project.(*Type).MethodFoo()
// path/to/src.go:line
// github.com/user/project.MethodBar()
#!/bin/python
# vim: ft=python
import fileinput
import sys
pods = open(sys.argv[1], 'r').readlines()
cluster_nodes = open(sys.argv[2], 'r').readlines()
#!/bin/bash
set -euo pipefail
table="${1:-}"
view="${2:-}"
if [[ -z "$table" || -z "$view" ]]; then
echo "Usage: $0 <table> <view>"
exit 1