Skip to content

Instantly share code, notes, and snippets.

Avatar
🇨🇿

Jakub Ráček kubaracek

🇨🇿
  • Pleo.io
  • Innsbruck, Austria
View GitHub Profile
View gist:4be2af808ad183f1603573d99f85f3a8
gsutil iam ch serviceAccount:db-backup-account@project.iam.gserviceaccount.com:objectAdmin gs://tvujproject/bucket-na-backupy
@kubaracek
kubaracek / Dockerfile
Last active Apr 20, 2021
TimescaleDB HA with WLTREE extension Dockerfile
View Dockerfile
FROM timescale/timescaledb-ha:pg12-latest
USER root
RUN apt-get update \
&& apt-get install -y \
git \
build-essential \
musl-dev \
libpq-dev \
View smaply.tf
resource "helm_release" "smaply" {
name = "smaply-${var.name_suffix}"
chart = "${path.module}/files/charts/smaply"
namespace = var.namespace
timeout = 600
wait = true
set {
name = "smaply.host"
value = var.host
View gist:f2b727881bb2c12f74d8c3384849727c
authorizedCallback :: MonadIO m => Maybe TL.Text -> Maybe TL.Text -> AppT m (Authorized)
authorizedCallback mc ms = do
case (mc, ms) of
(Just code, Just state) -> do
cache <- asks configCache
let eitherIdpApp = parseIDP (TL.takeWhile (/= '.') state)
case eitherIdpApp of
Right (IDPApp idp) -> fetchTokenAndUser cache code idp
Left _ -> throwError err400
View keybase.md

Keybase proof

I hereby claim:

  • I am kubaracek on github.
  • I am kubaracek (https://keybase.io/kubaracek) on keybase.
  • I have a public key whose fingerprint is 8BE5 91DA 145D 62DE D043 B0B8 DCFA DC3C 1622 2144

To claim this, I am signing this object:

View gist:3de395f644c4f4be7b6be20bd2ef0c07
irb(main):141:0> data
=> [{:id=>"197466", :category=>"section", :schema_id=>"invoice_info_section", :children=>[{:id=>"197467", :category=>"datapoint", :schema_id=>"invoice_number", :page=>1, :position=>[916, 168, 1190, 222], :value=>"FV103828806S", :validation_sources=>["score"], :type=>"string"}, {:id=>"197468", :category=>"datapoint", :schema_id=>"date_due", :page=>1, :position=>[938, 618, 1000, 654], :value=>"12/22/2018", :validation_sources=>["score"], :type=>"date"}, {:id=>"197469", :category=>"datapoint", :schema_id=>"amount_due", :page=>1, :position=>[1134, 1050, 1190, 1080], :value=>"55.20", :validation_sources=>["human"], :type=>"number"}]}, {:id=>"197500", :category=>"section", :schema_id=>"line_items_section", :children=>[{:id=>"197501", :category=>"multivalue", :schema_id=>"line_items", :children=>[{:id=>"198139", :category=>"tuple", :schema_id=>"line_item", :children=>[{:id=>"198140", :category=>"datapoint", :schema_id=>"item_desc", :page=>1, :position=>[173, 883, 395, 904], :value=>"Red Rose",
View keybase.md

Keybase proof

I hereby claim:

  • I am kubaracek on github.
  • I am kubaracek (https://keybase.io/kubaracek) on keybase.
  • I have a public key whose fingerprint is 9E62 6ABB A0B7 87E1 3385 DF6D 2BCC 6FC9 E9EA 8CB8

To claim this, I am signing this object:

View test.hs
validWords (Round (Player "Kuba") (Available "abcd") [(Guess "a"), (Guess "abb"), (Guess "ab"), (Guess "d")] [YellowCard])
-- ["a","ab","d"]
validWords (Round (Player "Kuba") (Available "abcd") [(Guess "a"), (Guess "abb"), (Guess "ab"), (Guess "d")] [YellowCard, YellowCard])
-- ["a","ab"]
validWords (Round (Player "Kuba") (Available "abcd") [(Guess "a"), (Guess "abb"), (Guess "ab"), (Guess "d")] [RedCard])
-- ["a","ab"]
View wordpuzzle.hs
-- |
module Game where
import Data.List (isInfixOf, sort, nub, any)
newtype Available = Available String deriving (Show, Eq)
type Word = [Char]
data WordError = NothingAvailable | CharNotAvailable Char deriving (Show)
deleteFirst _ [] = []
View useWord.hs
useWord :: Game.Word -> AvailableChars -> Maybe AvailableChars
useWord [] [] = Just []
useWord (a) [] = Nothing
useWord [] (a) = Just a
useWord (x:xs) (y)
| elem x y = useWord xs $ deleteFirst x y
| otherwise = Nothing