Skip to content

Instantly share code, notes, and snippets.

@ekuzmichev
ekuzmichev / TypeScript_React_Naming_Conventions.md
Last active July 11, 2024 14:48
TypeScript + React Naming Conventions
  • TS file with single exported function

File name format: lowerCamelCase.ts (the same as funciton name)

calculateSum.ts

export const calculateSum = (numbers: number[]): number =>
  numbers.reduce((acc, next) => acc + next, 0);
  • TS file with bunch of functions exported as a module
@ekuzmichev
ekuzmichev / remove_git_local_gone_branches.sh
Last active August 9, 2024 12:57
GIT: Remove all local branches that do not exist (gone) on remote
git fetch -p && for branch in $(git branch -vv | grep ': gone]' | awk '{print $1}'); do git branch -D $branch; done
@ekuzmichev
ekuzmichev / ZLayerPlayground.scala
Last active June 9, 2020 12:48
ZIO ZLayer DI playground
import zio._
object ZLayerPlayground {
case class User(id: String, name: String)
class MongoDb {
def insertUser(user: User): Task[Unit] = Task.succeed(()) <* UIO(println(s"[MongoDb]: Inserted user $user"))
}
object MongoDbLayer {