Skip to content

Instantly share code, notes, and snippets.

View rupeshtr78's full-sized avatar

rupeshtr78 rupeshtr78

View GitHub Profile
@rupeshtr78
rupeshtr78 / fzf_history.lua
Last active May 26, 2024 19:27
Windows FZF history search with cmder ,clink
-- 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")
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"),
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
package MoniodsFunctorMonad
object MonadBasic {
trait Functor[T] {
def map[Y](f: T => Y): Functor[Y]
}
trait Monad[T] extends Functor[T] {
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)
}
trait GeneralTrait {
def f: Int
}
class BaseImpl extends GeneralTrait {
override def f: Int = 5
}
class BaseImpl2 extends GeneralTrait {
override def f: Int = 50
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 {
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
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()
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 {})"