Skip to content

Instantly share code, notes, and snippets.

View RunBg.scala
package kupasyomtov.igudbneitorah.scripts
import bleep.commands.Compile
import bleep.internal.{TransitiveProjects, jvmRunCommand}
import bleep.model.{CrossProjectName, ProjectName}
import bleep.{BleepFileWatching, BleepScript, Commands, FileWatching, PathOps, Started}
import java.nio.file.Files
import scala.jdk.CollectionConverters.*
View Git aliases for fish
# migrating from
# Aliases
alias g='git'
#compdef g=git
alias gst='git status'
#compdef _git gst=git-status
alias gd='git diff'
#compdef _git gd=git-diff
alias gdc='git diff --cached'
nafg / toVDOM.scala
Last active November 20, 2022 02:53
HTML to scalajs-react VDOM
View toVDOM.scala
#!/usr/bin/env amm
import scala.xml.{Elem, Node, Text, XML}
def quoteString(s: String) =
'"' +
s.replace("\n", "\\n").replace("\"", "\\\"") +
nafg / SlickMigration.scala
Created October 2, 2022 16:07
View SlickMigration.scala
import scala.concurrent.duration.Duration
import scala.concurrent.{Await, ExecutionContext}
import slick.dbio.DBIO
import org.flywaydb.core.api.migration.{BaseJavaMigration, Context}
abstract class SlickMigration extends BaseJavaMigration {
implicit val executionContext: ExecutionContext =
nafg /
Last active August 16, 2022 23:25
import geny.Generator
import mill._
import mill.define.Target
import mill.scalajslib._
object WebpackLib {
View GenerateBeanCaseClass.scala
import java.beans.Introspector
import java.nio.file.{Files, Paths}
object GenerateBeanCaseClass extends App {
val typeRenderings = Map[Class[_], String](
classOf[String] -> "String",
classOf[Boolean] -> "Boolean",
classOf[Int] -> "Int"
View PartialState.scala
package chesednow.requests.sjs
import japgolly.scalajs.react.Callback
import japgolly.scalajs.react.vdom.VdomNode
import cats.implicits._
import monocle.{Iso, Prism}
trait PartialStateBase[V] {
type State
nafg / SlickMetaGenPlugin.scala
Last active August 17, 2020 21:59
Simple code generator for Slick using Scalameta rather than strings, as an SBT plugin
View SlickMetaGenPlugin.scala
import java.sql.Types
import scala.annotation.tailrec
import scala.concurrent.Await
import scala.concurrent.duration.Duration
import scala.meta._
import slick.dbio.DBIO
import slick.jdbc.meta.{MColumn, MQName, MTable}
View gist:2d37164b0b5501b417a6002dcaab4303
[1/547] mill.scalalib.ZincWorkerModule.compilerInterfaceClasspath
[2/547] mill.scalalib.ZincWorkerModule.classpath
[4/547] shared_common.js.upstreamCompileOutput
[5/547] shared_common.js.sources
[6/547] shared_common.js.generatedSources