Skip to content

Instantly share code, notes, and snippets.

@moeinxyz
moeinxyz / README.md
Last active June 8, 2020 05:21
Integrate SDKMAN and Direnv

Direnv and SDKMAN integration

Motivation

In a time when you work on multiple projects with different development environments (mostly in JVM ecosystem), It's hard and repetitive work to change your env or java version, etc. I found the integration between sdkman and direnv as a solution for myself.

Requirments

  • Install sdkman SDKMAN! is a tool for managing parallel versions of multiple Software Development Kits on most Unix based systems.
  • Install direnv direnv is an extension for your shell. It augments existing shells with a new feature that can load and unload environment variables depending on the current directory.
@asukakenji
asukakenji / 0-go-os-arch.md
Last active July 24, 2024 05:41
Go (Golang) GOOS and GOARCH

Go (Golang) GOOS and GOARCH

All of the following information is based on go version go1.17.1 darwin/amd64.

GOOS Values

GOOS Out of the Box
aix
android
@rafaeltuelho
rafaeltuelho / jvm-useful-arguments.md
Last active May 21, 2018 11:57
Useful JVM command line arguments (gc logging)
  • used to start a Standalone EAP instance:
/usr/lib/jvm/java/bin/java -D[Standalone] -server \
-verbose:gc \
-Xloggc:$EAP_HOME/standalone/log/gc_%p_%t.log \
-XX:+PrintGCDetails \
-XX:+PrintGCDateStamps \
@lihaoyi
lihaoyi / play.scala
Last active April 18, 2017 08:18
play.scala
/**
* Single-file play framework application! Make sure everything
* works, as this is the test case that un-earthed #371
*/
load.ivy("com.typesafe.play" %% "play" % "2.5.0")
load.ivy("com.typesafe.play" %% "play-netty-server" % "2.5.0")
load.ivy("org.scalaj" %% "scalaj-http" % "2.2.1")
@
@saeidzebardast
saeidzebardast / youtube-dl-playlist
Last active April 29, 2022 16:12
Download Youtube playlist in a folder and indexing videos using youtube-dl
alias youtube-dl-playlist="youtube-dl --ignore-errors --output '%(playlist)s/%(playlist_index)s- %(title)s.%(ext)s'"
@pchiusano
pchiusano / error.log
Created September 3, 2015 19:12
Epic compile error from Scala
> compile
[info] Compiling 1 Scala source to /Users/pchiusano/Dropbox/projects/scalaz-stream/target/scala-2.11/classes...
[error] /Users/pchiusano/Dropbox/projects/scalaz-stream/src/main/scala/streams/Process1.scala:27: polymorphic expression cannot be instantiated to expected type;
[error] found : [F(in method run)(in method run)(in method run)(in method run)(in method run)(in method run)(in method run)(in method run)[_], I2(in method run)(in method run)(in method run)(in method run)(in method run)(in method run)(in method run)(in method run) <: I]streams.Stream.Handle[F(in method run)(in method run)(in method run)(in method run)(in method run)(in method run)(in method run)(in method run),I] => streams.Pull[F(in method run)(in method run)(in method run)(in method run)(in method run)(in method run)(in method run)(in method run),O,streams.Stream.Handle[F(in method run)(in method run)(in method run)(in method run)(in method run)(in method run)(in method run)(in method run),I2(in method run)(in method run)(in
@cb372
cb372 / jargon.md
Last active May 14, 2024 03:45
Category theory jargon cheat sheet

Category theory jargon cheat sheet

A primer/refresher on the category theory concepts that most commonly crop up in conversations about Scala or FP. (Because it's embarassing when I forget this stuff!)

I'll be assuming Scalaz imports in code samples, and some of the code may be pseudo-Scala.

Functor

A functor is something that supports map.

@jrudolph
jrudolph / TestMultipartFileUpload.scala
Last active February 13, 2023 18:09
akka-http Multipart file-upload client + server example
package akka.http.scaladsl
import java.io.File
import akka.http.scaladsl.unmarshalling.Unmarshal
import akka.util.ByteString
import scala.concurrent.duration._
import akka.actor.ActorSystem
@fadhlirahim
fadhlirahim / installing_supervisor_macosx.md
Last active December 31, 2023 14:45
Setting up supervisord in Mac OS X

Installation

Installing Supervisor on OS X is simple:

sudo pip install supervisor

This assumes you have pip. If you don't:

@javierfs89
javierfs89 / Strip.scala
Created June 9, 2014 11:27
StripMargin string interpolator macro
/**
* This interpolator can be evaluated in compile time, so you can use to generate
* constant strings (if all params are also constant)
*
* Works on Scala 2.10.2
*/
implicit class stripInterpolator(sc: StringContext) {
def strip(params: Any*) = macro stripMacro
}