Skip to content

Instantly share code, notes, and snippets.

@pdalpra
pdalpra / starship.nix
Created February 23, 2022 16:48
fun with configuring starship in Nix home-manager
{ pkgs, lib, ... }:
with lib;
with builtins;
let
isRustFile = path: type:
hasSuffix ".rs" path && type == "regular" && path != "mod.rs";
mergeAllAttrSets = attrsSets:
foldl' (recursiveUpdate) {} attrsSets;
@pdalpra
pdalpra / DisciplineSuite.scala
Created April 3, 2020 07:37
MUnit - Discipline and ZIO custom suites
package suites
import munit.{ Location, ScalaCheckSuite, TestOptions }
import org.typelevel.discipline.Laws
abstract class DisciplineSuite extends ScalaCheckSuite {
def laws(name: String, body: => Laws#RuleSet)(implicit loc: Location): Unit =
laws(new TestOptions(name, Set.empty, loc), body)
@pdalpra
pdalpra / auto_monitor.sh
Created August 7, 2016 17:41
auto_monitor
#!/bin/bash
export DISPLAY=:0
export XAUTHORITY=/home/pdalpra/.Xauthority
function mirror() {
xrandr --output eDP1 --dpi 168 --output DP1 --mode 1920x1080 --scale 1.67x1.67
}
function single() {
@pdalpra
pdalpra / wav_to_flac.scala
Created May 11, 2014 20:20
Wav -> Flac Converter
import java.io.File
import java.util.concurrent.{ Callable, ForkJoinPool }
import scala.annotation.tailrec
import scala.collection.JavaConverters._
import scala.sys.process.Process
import scala.util.Try
val source = Try(args(0)).toOption
val dest = Try(args(1)).toOption