Skip to content

Instantly share code, notes, and snippets.

View exaV's full-sized avatar

Patrick Del Conte exaV

View GitHub Profile
@exaV
exaV / sms.py
Created September 17, 2016 10:19
if not currentCall is None:
#helllsfsnäkg
msg = currentCall.initialText
if msg == "yes":
say("go get some")
else:
call(phonenumber, {"network":"SMS"})
say(msg)
@exaV
exaV / call.py
Last active September 17, 2016 21:42
call(phonenumber)
say("hi")
say(msg)
promtForAnswer()
hangup()
def promtForAnswer():
result = ask("Press 1 if you understood this message Press 2 to hear it again Press 3 to call your emergency number", {
"choices":"1,2,3",
"terminator":"#",
grammar cql;
//query language losely based on CQL https://www.loc.gov/standards/sru/cql/spec.html
CUSTOM_QUERY_TOKEN : 'name' | 'lastname';
//TOKENS
LIKE : 'like' | '=' ;
EQUALS : 'eq' | 'equals' | 'exact' | 'is' ;
GT : 'greater' | '>' | 'after' ;
LT : 'smaller' | '<' | 'before' ;
@exaV
exaV / README.md
Last active September 19, 2023 09:56
Ngninx template for Openshift with ConfigMap

Ngninx template for Openshift

Create a full deployment for an Nginx Proxy that reads its configuration from a config map.

The config map can be edited online and only requires a rolling deployment to take effect.

Quickstart:

oc new-app -f https://gist.githubusercontent.com/exaV/978c4d9ac66b2940da141340f08bb82a/raw/nginx-template.yaml -p NAME="my-proxy"

.soutv : print an expression to System.out
ARRAY → System.out.println("\n\n$escapedExpr*:escapeString(expr)$ = " + java.util.Arrays.toString($expr$) + "\n");
NON_VOID → System.out.println("\n\n$escapedExpr*:escapeString(expr)$ = " + $expr$ + "\n");
@exaV
exaV / README.md
Last active April 28, 2020 10:08
screeps stack trace resolver

Stack trace resolver for screeps

If you run this from the builtin terminal in IntellJ you will get clickable links to the source.

Usage

kotlin resolver.main.kts -- -h

You need the -- to separate the arguments to kotlin from the arguments to the script.

@exaV
exaV / docker-grep.sh
Last active August 25, 2020 12:56
A fuzzy wrapper for the docker cli. Execute a docker command for all containers who match a search term. Do something sensible if no command or no search terms are provided.
docker_ps_formatted(){ docker ps -a --format "table {{.Names}}\t{{.Image}}\t{{.Status}}\t{{.Ports}}" }
# dockerg [ARGS] SEARCH
# basically docker ps | grep SEARCH | xargs docker ARGS
# but all args are optional
# e.g. 'dockgerg bank' -> check which services are found; dockgerg logs --tail 15 bank -> log the service
# e.g. 'dockerg start Exited' -> start all containers with status 'Exited'
dockgerg(){
if [ "$#" -eq 0 ]; then docker_ps_formatted; return; fi
SEARCH=${@:$#};
if [ "$#" -eq 1 ]; then docker_ps_formatted | grep $SEARCH; return; fi
@exaV
exaV / RestorableContext.kt
Last active August 7, 2020 17:41
Screeps restorable coroutines
package util.coroutines.restorable
import screeps.api.MutableRecord
import screeps.api.get
import screeps.api.keys
import screeps.api.set
import screeps.utils.unsafe.delete
import kotlin.coroutines.Continuation
import kotlin.coroutines.CoroutineContext
import kotlin.coroutines.intrinsics.COROUTINE_SUSPENDED
@exaV
exaV / .ideavimrc
Last active August 15, 2022 14:25
vim and ideavim (https://github.com/JetBrains/ideavim) configuration
source ~/.vimrc
set ideamarks
set ideaput
set showmode
" ideavim plugins
" https://github.com/JetBrains/ideavim/wiki/Emulated-plugins
set NERDTree
set commentary
set argtextobj
@exaV
exaV / proxy-to-mitm-gnome.sh
Created October 28, 2021 09:37
mitmproxy setup
echo "enable proxy for http/https traffic"
gsettings set org.gnome.system.proxy.http host 'localhost'
gsettings set org.gnome.system.proxy.http port '8089'
gsettings set org.gnome.system.proxy.https host 'localhost'
gsettings set org.gnome.system.proxy.https port '8089'
gsettings set org.gnome.system.proxy mode 'manual'
mitmweb --listen-port 8089 --web-port 8083
gsettings set org.gnome.system.proxy mode 'none'
echo ""
echo "disable proxy"