Skip to content

Instantly share code, notes, and snippets.

View vpatryshev's full-sized avatar
💭
married

Vlad Patryshev vpatryshev

💭
married
View GitHub Profile
@vpatryshev
vpatryshev / EnvHacker.scala
Last active August 4, 2021 12:29 — forked from jaytaylor/EnvHacker.scala
Setting environment variables in Scala JVM
import java.util.{Collections, Map => JavaMap}
import scala.collection.JavaConverters._
trait EnvHacker {
/**
* Portable method for setting env vars on both *nix and Windows.
* @see http://stackoverflow.com/a/7201825/293064
*/
def setEnv(newEnv: Map[String, String]): Unit = {
try {
@vpatryshev
vpatryshev / package.scala
Created December 16, 2015 06:10 — forked from zraffer/package.scala
a few operations with functors
package object types {
import scala.language.reflectiveCalls
import scala.language.higherKinds
// quantifiers aka (co)ends
type Forall[+F[_]] = { def apply[X]: F[X] }
type Exists[+F[_]] = F[_]
// basic categorical notions