Skip to content

Instantly share code, notes, and snippets.

View kesor's full-sized avatar
🏠
Working from home

Evgeny Zislis kesor

🏠
Working from home
View GitHub Profile
@kesor
kesor / .eslintrc.js
Last active May 14, 2020 05:51
eslint
module.exports = {
env: {
browser: true,
commonjs: true,
es2020: true,
node: true,
mocha: true
},
extends: [
'eslint:recommended',
@kesor
kesor / Dockerfile
Last active August 11, 2023 21:17
Compile DENO on Alpine (w/MUSL C)
FROM rust:alpine
RUN apk add --no-cache \
bash \
binutils-gold \
ca-certificates \
clang \
curl \
g++ \
git \
@kesor
kesor / closed-captions-realtime.html
Last active April 29, 2020 02:12
use speech recognition and output captions into console
<html>
<body>
<button id="button" onclick="toggleStartStop()"></button>
<div style="border:dotted;padding:10px">
<span id="final_span"></span>
<span id="interim_span" style="color:grey"></span>
</div>
<script type="text/javascript">
var recognizing;
var recognition = new (window['SpeechRecognition'] || window['webkitSpeechRecognition'])
@kesor
kesor / vinny3693-build-script.sh
Created April 6, 2020 20:23
Remove all the Python files and replace them with a tiny shell script
#!/bin/sh
just_the_file_please() {
sed -e 's!^[^/]*\(/.*\)$!\1!'
}
remove_magic() {
sed -e 's!__pycache__/!!; s!\.[^.]*\.pyc$!.pyc!'
}
const hierarchy = {
config: {
settings: sinon.fake(),
log: {
info: sinon.fake()
}
}
}
verifyPassword(hierarchy)
@kesor
kesor / xml2json.js
Last active November 18, 2019 22:48
Slightly cleaned up version of xml2json by Stefan Goessner/2006 http://goessner.net
/* This work is licensed under Creative Commons GNU LGPL License.
License: http://creativecommons.org/licenses/LGPL/2.1/
Version: 0.9
Author: Stefan Goessner/2006
Web: http://goessner.net/
Original file: https://goessner.net/download/prj/jsonxml/
*/
function xml2json(xml) {
@kesor
kesor / keybase.md
Created August 19, 2019 10:09
keybase.md

Keybase proof

I hereby claim:

  • I am kesor on github.
  • I am kesor (https://keybase.io/kesor) on keybase.
  • I have a public key ASBXaH4PUfL6oeNFmPX5ZOyZ-9aO21ZE9wc-gtK5o4dnZQo

To claim this, I am signing this object:

@kesor
kesor / cloudtrail-template-elasticsearch.json
Last active February 5, 2022 02:59
An ElasticSearch Index template for CloudTrail events
PUT _template/cloudtrail
{
"index_patterns": ["cloudtrail-*"],
"settings": {
"number_of_shards": 1,
"mapping": {
"total_fields": {
"limit": 10000
}
}
@kesor
kesor / setup-helm.sh
Last active January 24, 2019 20:26
Setup HELM/Tiller with TLS verification and Cluster Admin RBAC role link
#!/bin/bash
HELM_TILLER_SA=tiller
HELM_TILLER_NS=kube-system
tiller_tls() {
[ ! -f tiller-ca.crt ] && \
openssl req -x509 -new -newkey rsa:2048 -keyout tiller-ca.key -nodes -sha256 -days 3650 -out tiller-ca.crt -subj "/CN=tiller-ca"
[ ! -f tiller.crt ] && {
echo subjectAltName=IP:127.0.0.1 > extfile.cnf
@kesor
kesor / tsm.diff
Last active December 9, 2018 21:42
TradeSkillMaster Crafting Operation restock quantity from CustomPrice source
diff --git a/Core/Service/Crafting/Core.lua b/Core/Service/Crafting/Core.lua
index c2e2bf3..752013f 100644
--- a/Core/Service/Crafting/Core.lua
+++ b/Core/Service/Crafting/Core.lua
@@ -548,7 +548,10 @@ function Crafting.RestockHelp(link)
end
+ local maxRestock = TSMAPI_FOUR.CustomPrice.GetValue(opSettings.maxRestock, itemString)
+ local minRestock = TSMAPI_FOUR.CustomPrice.GetValue(opSettings.minRestock, itemString)
+