Skip to content

Instantly share code, notes, and snippets.

View flurdy's full-sized avatar

Ivar Abrahamsen flurdy

View GitHub Profile
@KiyonoKara
KiyonoKara / Publish Scala Packages.md
Last active July 28, 2024 13:59
A guide for publishing Scala packages to GitHub's Apache Maven registry.

Publishing Scala Packages to the GitHub Package Registry

Steps

  1. Configure your package naming and organization (generally optional).
   org  
    ⤷ name
       ⤷ package
 
@moeinxyz
moeinxyz / README.md
Last active May 12, 2025 13:31
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.
@dersam
dersam / gitkraken.zsh
Last active March 13, 2025 01:32
Open GitKraken using the current repo directory in the cli.
## Open GitKraken using the current repo directory.
## For when you want a prettier view of your current repo,
## but prefer staying in the cli for most things.
## This will break if GitKraken ever removes the -p flag.
## If you're not using OSX, the path is definitely different.
kraken () {
~/Applications/GitKraken.app/Contents/MacOS/GitKraken -p $(pwd)
}
@katta
katta / mvncolor.sh
Created June 15, 2011 18:50
Script to add colors to maven output
#!/usr/bin/env bash
# Formatting constants
export BOLD=`tput bold`
export UNDERLINE_ON=`tput smul`
export UNDERLINE_OFF=`tput rmul`
export TEXT_BLACK=`tput setaf 0`
export TEXT_RED=`tput setaf 1`
export TEXT_GREEN=`tput setaf 2`
export TEXT_YELLOW=`tput setaf 3`
@jorgeortiz85
jorgeortiz85 / PrivateMethodCaller.scala
Created April 7, 2011 15:41
Calling private methods in Scala
// Usage:
// p(instance)('privateMethod)(arg1, arg2, arg3)
class PrivateMethodCaller(x: AnyRef, methodName: String) {
def apply(_args: Any*): Any = {
val args = _args.map(_.asInstanceOf[AnyRef])
def _parents: Stream[Class[_]] = Stream(x.getClass) #::: _parents.map(_.getSuperclass)
val parents = _parents.takeWhile(_ != null).toList
val methods = parents.flatMap(_.getDeclaredMethods)
val method = methods.find(_.getName == methodName).getOrElse(throw new IllegalArgumentException("Method " + methodName + " not found"))