Skip to content

Instantly share code, notes, and snippets.

@kv109
kv109 / twilio-templates.txt
Created January 26, 2022 11:59
SMS templates to register in Norway and Finland
TEMPLATE 1 (LANGUAGE CODE: CS):
Vítejte v Motimate!
Kliknutím sem můžeš začít: https://motimateapp.com/go?id=%{identifier_name}
Následovat budou přihlašovací údaje.
TEMPLATE 2 (LANGUAGE CODE: CS):
Ahoj, jen přátelské připomenutí od společnosti :)
Kliknutím sem můžeš začít: https://motimateapp.com/go?id=%{identifier_name}
Následovat budou přihlašovací údaje.
@kv109
kv109 / export-pod-name.md
Created June 22, 2018 10:36
export pod names in kubernetes
  1. Create a export-pod-name.sh file with the following content:
POD_NAME=$(kubectl get pods --sort-by=.metadata.creationTimestamp --selector=YOUR-SELECTOR-KEY=YOUR-SELECTOR-VALUE -o go-template --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}' | tail -n1)
# Example:
# POD_NAME=$(kubectl get pods --sort-by=.metadata.creationTimestamp --selector=app=nginx -o go-template --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}' | tail -n1)

export POD_NAME=$POD_NAME
@kv109
kv109 / new-mp-kit-auth.md
Last active April 23, 2018 10:20
new mp-kit auth scenario

Marketplace KIT authorization flow is gonna change very soon.

Please help with testing the new flow!

(Yes, QA guys, I'm hoping that you'll help ;))

  • Uninstall your mp-kit:
npm uninstall -g @platform-os/marketplace-kit

Verify that you don't have marketplace-kit:

@kv109
kv109 / diff-challenge.md
Created March 13, 2017 17:03
Diff Challenge

Diff Challenge

Concept

Good codebase is easily modifiable. Diff Challenge verifies how easy is to add a new feature to your application or change its existing behavior. This process is done in two steps.

In the first step you write code according to a provided specification.

In the second step, you receive a new version of the spec, which contains some new requirements.

@kv109
kv109 / aes8.rb
Last active December 31, 2016 18:38
aes8
"pa".hex #=> 0
"ss".hex #=> 0
"wo".hex #=> 0
"rd".hex #=> 0
"".hex #=> 0
"password".unpack("a2"*32).map { |x| x.hex }
#=> [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
"totally wrong password".unpack("a2"*32).map { |x| x.hex }
#=> [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
@kv109
kv109 / aes8.rb
Created December 27, 2016 18:43
aes8
"password".unpack("a2"*32)
=> ["pa", "ss", "wo", "rd", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""]
@kv109
kv109 / aes7.rb
Last active December 29, 2016 21:07
aes7
'9'.hex #=> 9
'a'.hex #=> 10
'10'.hex #=> 16
'ff'.hex #=> 255
# zero is returned on error:
'foobar'.hex #=> 0
'zz'.hex #=> 0
@kv109
kv109 / aes6.rb
Created December 27, 2016 18:16
aes6
@cipher.key = @key.unpack('a2'*32).map{|x| x.hex}.pack('c'*32)
@kv109
kv109 / aes5.rb
Last active December 27, 2016 23:07
aes5
encrypted = AES.encrypt("Super secret message", "password")
decrypted = AES.decrypt(encrypted, "totally wrong password")
decrypted #=> Super secret message
@kv109
kv109 / aes4.rb
Last active December 27, 2016 23:02
aes4
encrypted = AES.encrypt("Super secret message", "password")
decrypted = AES.decrypt(encrypted, "ggssword") # "pa" => "gg"
decrypted #=> Super secret message