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
-- fzf clink history search | |
-- update cmder\vendor\clink >= clink -- version = 1.1.44 | |
-- install fzf choco install fzf | |
-- add the fzf_history.lua to cmder\config folder | |
-- add below key binding to _inputrc use "clink info" to find inputrc path | |
-- M-x: "luafunc:fzf_history" #Alt x | |
-- Might have to adjust your regex in line 38 39 based on your settings | |
-- reference https://chrisant996.github.io/clink/clink.html | |
settings.add("fzf.height", "40%", "Height to use for the --height flag") |
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 collections | |
import scala.collection.immutable | |
object ScalaForComprehension { | |
case class Person(first: String, last: String) | |
val persons: List[Person] = List( | |
Person("Rupesh", "Raghavan"), | |
Person("Roopa", "Rupesh"), |
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 MoniodsFunctorMonad | |
object MonoidBasics { | |
trait Monoid[T] { | |
def op(l: T, r: T): T | |
def zero: T | |
} | |
val intAddMoniod:Monoid[Int] = new Monoid[Int] { | |
override def op(l: Int, r: Int): Int = 1 + r |
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 MoniodsFunctorMonad | |
object MonadBasic { | |
trait Functor[T] { | |
def map[Y](f: T => Y): Functor[Y] | |
} | |
trait Monad[T] extends Functor[T] { |
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 MoniodsFunctorMonad | |
object FunctorBasics { | |
trait Functor[F[_]] { | |
def map[T, Y](l: F[T])(f: T => Y): F[Y] | |
} | |
val listFunctor = new Functor[List] { | |
override def map[T, Y](l: List[T])(f: T => Y): List[Y] = l.map(f) | |
} |
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
trait GeneralTrait { | |
def f: Int | |
} | |
class BaseImpl extends GeneralTrait { | |
override def f: Int = 5 | |
} | |
class BaseImpl2 extends GeneralTrait { | |
override def f: Int = 50 |
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 scalabeginner.jsonJackson | |
import org.json4s._ | |
import org.json4s.jackson.JsonMethods._ | |
import scala.io.Source | |
case class Person(firstName: String, lastName: String, age: Int) | |
object ReadJson 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
package scalabeginner.algebraicdatatypes | |
object AlgebraicDataTypes extends App { | |
//Sum ADT | |
sealed abstract trait Month | |
case object January extends Month | |
case object February extends Month | |
case object March extends Month | |
case object April extends Month |
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
trait A { | |
def hello():String = "Trait A" | |
} | |
trait B extends A { | |
override def hello(): String = "Trait B ->" + super.hello() | |
} | |
trait C extends A { | |
override def hello(): String = "Trait C->" + super.hello() |
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
cmderr=cd /d "%CMDER_ROOT%" | |
cdesk=cd /d C:\Users\rupes\Desktop | |
cdown=cd /d C:\Users\rupes\Downloads | |
cml=cd /d C:\Users\rupes\Desktop\ML\AllMaterials | |
rgx=rg -i -l -e $1 -t $2 -g "!{sbt,cache}" | fzf --preview="bat {} --color=always --theme=GitHub" --bind "enter:execute(vim -no {})+abort" | |
rgc=rg -i -l -e $1 -t $2 -g "!{sbt,cache}" | fzf --preview="bat {} --color=always --theme=GitHub" --bind "enter:execute(clip < {})+abort" | |
rgf=rg --files -g "!{sbt,cache,target,out,build,.git,resources}"| fzf --height 50% --reverse --preview "bat {}" -bind "enter:execute(vim -no {})+abort" | |
fx=fzf --preview="bat {} --color=always" --bind "enter:execute(vim -no {})" | |
hf=cat "%CMDER_ROOT%\config\.history" | fzf -i --reverse --height=25% --select-1 | clip | |
fcx=fd -t d .| fzf -i --reverse --height=25% --bind "enter:execute(xargs -0 explorer {})" |
NewerOlder