Skip to content

Instantly share code, notes, and snippets.

View yashsriv's full-sized avatar
🤯
Developing

Yash Srivastav yashsriv

🤯
Developing
View GitHub Profile
@yashsriv
yashsriv / keybase.md
Created August 15, 2018 10:27
Keybase.io certification

Keybase proof

I hereby claim:

  • I am yashsriv on github.
  • I am yashsriv (https://keybase.io/yashsriv) on keybase.
  • I have a public key whose fingerprint is A351 1A95 1BA5 498E C9B6 41A9 0A90 380A 06FD 4E64

To claim this, I am signing this object:

@yashsriv
yashsriv / cvimrc.vim
Last active May 28, 2016 11:32
My chromium-vim rc
" Settings
set noautofocus
set numerichints
set typelinkhints
set smoothscroll
set autoupdategist
let barposition = "bottom"
let searchlimit = 10
@yashsriv
yashsriv / HttpStream.scala
Last active May 10, 2016 12:55
HTTP-akka
import akka.actor.ActorSystem
import akka.http.scaladsl.Http
import akka.http.scaladsl.model._
import akka.http.scaladsl.server.Directives._
import akka.stream.ActorMaterializer
import scala.io.StdIn
object HttpStream extends App {
implicit val system = ActorSystem("my-system")
implicit val materializer = ActorMaterializer()
@yashsriv
yashsriv / collections.scala
Last active May 5, 2016 16:17
Scala Collections framework
object collection {
def main(args: Array[String]):Unit = {
// Different types of sequences
// Base class Seq whose base class is Iterable
// List
val l: List[Int] = List(1, 2, 3, 4)
/** Head access faster
* Useful for recursive algorithms
* accessing any element takes time
@yashsriv
yashsriv / tail-recursion-fact.scala
Created May 3, 2016 12:15
Tail Recursive factorial implementation
object Factorial {
def factorial(n: Int): Int = {
/** Martin Odersky in Lecture 1.7 mentions
* this implementation of factorial as tail
* recursive but when I put @tailrec annotation,
* compile fails
**/
//@tailrec
def loop(acc: Int, n: Int): Int =
if(n == 0) acc