Skip to content

Instantly share code, notes, and snippets.

package pl.ayeo
import cats.effect.{IO, IOApp, Ref}
import cats.effect.std.Queue
import cats.effect.unsafe.implicits.global
import cats.syntax.all.*
import fs2.{Pipe, Stream}
import scala.concurrent.duration.*
import scala.util.Random
package pl.ayeo
import cats.effect.{IO, IOApp, Ref}
import cats.effect.std.Queue
import cats.effect.unsafe.implicits.global
import cats.syntax.all.*
import fs2.{Pipe, Stream}
import scala.concurrent.duration.*
object ActorApp extends IOApp.Simple {
package pl.ayeo
import cats.effect.IO
import cats.effect.Ref
import cats.effect.std.Queue
import cats.effect.unsafe.implicits.global
import cats.syntax.all.*
import fs2.{Pipe, Stream}
import scala.concurrent.duration.*
package pl.ayeo
import cats.effect.IO
import cats.effect.Ref
import cats.effect.std.Queue
import cats.effect.unsafe.implicits.global
import cats.syntax.all.*
import fs2.{Pipe, Stream}
import scala.concurrent.duration.*
@ayeo
ayeo / 4bulbs.scala
Last active February 27, 2022 08:25
1 bulb 4 switches
package pl.ayeo
import cats.effect.{ExitCode, IO, IOApp, Ref}
import cats.implicits.*
import fs2.*
import cats.effect.unsafe.implicits.global
import scala.concurrent.duration.*
object Fs2App extends IOApp {
@ayeo
ayeo / SudokuSolver.scala
Last active February 15, 2020 09:57
Scala Sudoku Solver
import scala.collection.immutable.{Vector => $}
/**
* This is highly inspired by https://gist.github.com/pathikrit/a32e17832296befd6b94
* Actually only main recurssion block is changed for better readability
*
* See also excellent Computerphile video https://www.youtube.com/watch?v=G_UYXzGuqvM
*/
object Solver {
val n = 9
angular.module('myModule', ['ngRoute'])
.factory('MessageResolver', ['$q', '$timeout', function($q, $timeout)
{
var deferred = $q.defer();
$timeout(function()
{
deferred.resolve(['Hello', 'world!']);