Skip to content

Instantly share code, notes, and snippets.

@boseabhishek
boseabhishek / Panic vs os.Exit.md
Created January 26, 2024 12:56 — forked from Integralist/Panic vs os.Exit.md
[Golang: panic vs os.Exit] #go #golang #panic

panic signals "the programmer has made a fundamental mistake and execution cannot continue safely", whereas os.Exit signals "the programmer has decided that the process should terminate here" — different meanings. Also, important difference in behavior: panic will unwind the callstack, which means it will call any pending defer statements; os.Exit will just do a hard kill, so it won't.

@boseabhishek
boseabhishek / System Design.md
Created November 9, 2023 10:47 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@boseabhishek
boseabhishek / ImplicitSenderTest.scala
Created February 1, 2017 12:00 — forked from mguillermin/ImplicitSenderTest.scala
Sample showing basic usage of Akka TestKit and TestActorRef
package sample.akka.testkit
import akka.actor.ActorSystem
import akka.actor.Actor
import akka.testkit.{TestKit, TestActorRef}
import org.scalatest.matchers.MustMatchers
import org.scalatest.WordSpec
class ImplicitSenderTest extends TestKit(ActorSystem("testSystem"))
// Using the ImplicitSender trait will automatically set `testActor` as the sender