Skip to content

Instantly share code, notes, and snippets.

Avatar
🏗️
Building.

Oto Brglez otobrglez

🏗️
Building.
View GitHub Profile
View get-java-home.sh
# Oto Brglez - <otobrglez@gmail.com>
echo 'public class Main {public static void main(String[] args){ System.out.println(System.getProperty("java.home"));}}' > /tmp/Main.java && \
javac /tmp/Main.java && cd /tmp && java Main && rm Main.java && cd -
@otobrglez
otobrglez / my-project-dev.sh
Last active Nov 16, 2020
My "micro" wrapper for docker-compose
View my-project-dev.sh
#!/usr/bin/env bash
set -e
# Author: Oto Brglez, <otobrglez@gmail.com>
# "MY_PROJECT_HOME" - is environment variable, usually set with
# something like direnv (via .env) or let to developer
if [[ -z "${MY_PROJECT_HOME}" ]]; then
echo "MY_PROJECT_HOME environment variable is not set!" && exit 255
fi
@otobrglez
otobrglez / post2pdf.sh
Last active Nov 13, 2020
Markdown notes to PDFs with Pandoc (post2pdf.sh)
View post2pdf.sh
#!/usr/bin/env bash
# Author: Oto Brglez
# Mail: otobrglez@gmail.com
# Version: 0.0.2
# LICENCE: MIT
# Install:
# - https://pandoc.org/
# - https://github.com/Wandmalfarbe/pandoc-latex-template
# - https://www.overleaf.com/learn/latex/XeLaTeX
# - https://github.com/be5invis/Iosevka
View Trololo.scala
// Live is to short to not have fun.
// Oto Brglez
// @otobrglez
object Main extends App {
type `🐰` = String
type `👨‍💼` = `🐰`
type `💯` = Int
val (`n🆕`: `🐰`, `s👽`: `🐰`) = ("\n", " ")
val `👋`: (`👨‍💼`, `🐰`) => `🐰` = { (`👶`, `🐇`) =>
View web_hook_node.rb
class WebHookNode
has_many: :web_hook_expressions
has_many: :expression, thought: :web_hook_expressions
has_many :query_parameters, type: ....
has_many :body_parameters, type: ....
has_many :header_parameters, type: ...
end
View ErrorApp.scala
package com.opalab.experimental
import java.io.File
import cats.data.NonEmptyChain
import cats.implicits._
import io.circe.syntax._
import scala.io.Source
import scala.util.Using
@otobrglez
otobrglez / NodeApp.scala
Last active Jul 9, 2020
Simple Akka Cluster with decline and Akka Typed.
View NodeApp.scala
/**
* Author: Oto Brglez - <otobrglez@gmail.com>
*/
package com.pinkstack.realestate.clustering4
import akka.actor.typed._
import akka.actor.typed.scaladsl._
import akka.cluster.ClusterEvent.MemberEvent
import akka.cluster.typed._
import com.monovore.decline._
View Boot5.scala
package com.examples.streaming_one
import akka.Done
import akka.actor.ActorSystem
import akka.stream._
import akka.stream.scaladsl._
import slick.jdbc.JdbcBackend.Database
import slick.jdbc.PostgresProfile.api._
import slick.jdbc.{ResultSetConcurrency, ResultSetType}
@otobrglez
otobrglez / pg_optimisation.sql
Last active Mar 28, 2018
Optimising N+1 problem in PG with "json_agg"
View pg_optimisation.sql
WITH question_options_f AS
( SELECT id,
question_id,
name,
fixed,
nota,
name_html,
name_raw
FROM question_options
WHERE deleted_at IS NULL
@otobrglez
otobrglez / data.yml
Created Mar 21, 2018
Transforming yaml to another yaml.
View data.yml
header:
label: 'Header'
breakpoint:
fallback:
name: header_fallback
label: 'Header @ fallback (306 x 172)'
width: 306
height: 172
small:
name: header_small
You can’t perform that action at this time.