This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.hazelcast.client.HazelcastClient | |
import com.hazelcast.client.config.ClientConfig | |
import com.hazelcast.core.HazelcastInstance | |
import com.hazelcast.map.IMap | |
import zio.* | |
import scala.reflect.ClassTag | |
final class Hazelcast private (private val client: HazelcastInstance): | |
def getMap[K: ClassTag, V: ClassTag](name: String): IMap[K, V] = client.getMap[K, V](name) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Oto Brglez - July 2025 | |
// Our entity | |
final case class Book(title: String) | |
// Sample data. Books. yey! | |
val books @ List(programmingInScala, jsGoodParts, _*) = List( | |
Book("Programming in Scala"), | |
Book("JavaScript: The Good Parts"), | |
Book("Designing Data-Intensive Applications"), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Tiny Redis (Jedis) client wrapper for ZIO with Scala 3. | |
// - Oto Brglez - <[email protected]> - May 2025 | |
import redis.clients.jedis.*, redis.clients.jedis.params.* | |
import zio.*, zio.ZIO.* | |
import java.util.List as JavaList | |
import scala.concurrent.duration.*, scala.jdk.CollectionConverters.* | |
final case class Redis private (private val pool: JedisPool): | |
private type Binary = Array[Byte] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package si.ogrodje.flow.gql | |
import scala.annotation.targetName | |
object GQL: | |
private type Name = String | |
private type Arguments = Map[Name, Value] | |
private val emptyArguments: Arguments = Map.empty | |
private type Fields = List[Field] | |
private val emptyFields: Fields = List.empty |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import eu.timepit.refined.auto.autoUnwrap | |
import jakarta.mail.event.{MessageCountEvent, MessageCountListener} | |
import jakarta.mail.{Message, Session, Store} | |
import org.eclipse.angus.mail.imap.{IMAPFolder, SortTerm} | |
import zio.ZIO.{attempt, logInfo} | |
import zio.stream.{Stream, ZStream} | |
import zio.{Chunk, RIO, Scope, Task, ZIO} | |
import zio.durationInt | |
final case class MessageID( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package si.ogrodje.oge.scheduler | |
import cats.effect.unsafe.implicits.global | |
import cats.effect.{IO, Resource} | |
import fs2.Stream | |
import fs2.concurrent.Topic | |
import org.quartz.* | |
import org.quartz.JobBuilder.* | |
import org.quartz.TriggerBuilder.* | |
import org.quartz.impl.StdSchedulerFactory |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let | |
pkgs = import <nixpkgs> {}; | |
rubyEnv = pkgs.ruby_3_2.withPackages(p: with p; [ | |
pry | |
nokogiri | |
]); | |
in with pkgs; | |
mkShell { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.pinkstack.tttx | |
package mk2.services | |
import mk2.services.Protocol.Connected | |
import cats.* | |
import cats.effect.* | |
import cats.effect.std.Queue | |
import cats.syntax.all.* | |
import fs2.Stream |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Oto Brglez - <[email protected]> | |
$folderPath = "dodo-was-here" | Resolve-Path | |
Get-ChildItem -Path $folderPath -Recurse -File | | |
ForEach-Object { | |
$newName = Join-Path (Split-Path $_.FullName) ` | |
-ChildPath ($_.FullName -replace $folderPath,'' -replace '/|\\','-' -replace '^(.)','') | |
Rename-Item -Path $_.FullName -NewName $newName -Force # -WhatIf | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Oto Brglez - <[email protected]> | |
import net.greghaines.jesque.client.{Client as JesqueClient, ClientImpl} | |
import net.greghaines.jesque.worker.{JobFactory, MapBasedJobFactory, WorkerImpl} | |
import net.greghaines.jesque.{Config as JesqueConfig, ConfigBuilder, Job as JesqueJob} | |
import zio.* | |
import zio.Clock.currentTime | |
import zio.Console.printLine | |
import zio.ZIO.{acquireRelease, attempt, blocking, fail, logDebug, logError, logInfo, service, succeed} | |
import zio.stream.ZStream.fromQueue |
NewerOlder