This file contains 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 ca.vgorcinschi.cats | |
import cats.data.EitherT | |
import cats.implicits._ | |
import java.io.IOException | |
import scala.concurrent.Future | |
import scala.util.{Failure, Success} | |
object EitherTFutureTest extends App { |
This file contains 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
object FindLIS { | |
def findLIS(initialArray: Array[Int]): Int = { | |
if (initialArray.length < 2) return initialArray.length | |
val allSubSequences = initialArray.zipWithIndex.foldLeft(List.empty[Array[Int]]) { | |
case (currentSubSequences, (nextValue, index)) => | |
currentSubSequences ::: getSubsequenceFromArray(Array(nextValue), initialArray.drop(index)) | |
} |
This file contains 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 cats.Monad | |
import scala.annotation.tailrec | |
import scala.collection.mutable.ArrayBuffer | |
object CatsUtil { | |
implicit val arrayMonad: Monad[Array] = new Monad[Array] { | |
override def flatMap[A, B](fa: Array[A])(f: A => Array[B]): Array[B] = { | |
if (fa.isEmpty) return Array.empty |
This file contains 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
#!/bin/bash | |
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
} | |
PS1='\[\e[1;34m\]\u\[\e[m\] \[\e[0;32m\]\w\[\e[m\] $(parse_git_branch) \[\e[1;34m\]\$ \[\e[m\]\[\e[0;37m\]' | |
#PS1='\[\e[1;34m\]\u\[\e[m\] \[\e[0;32m\]\w\[\e[m\] \[\e[1;34m\]\$ \[\e[m\]\[\e[0;37m\]' | |
# If not running interactively, don't do anything |
This file contains 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
<?xml version="1.0" encoding="UTF-8"?> | |
<project version="4"> | |
<component name="CompilerConfiguration"> | |
<resourceExtensions /> | |
<wildcardResourcePatterns> | |
<entry name="!?*.java" /> | |
<entry name="!?*.form" /> | |
<entry name="!?*.class" /> | |
<entry name="!?*.groovy" /> | |
<entry name="!?*.scala" /> |