Skip to content

Instantly share code, notes, and snippets.

View raboof's full-sized avatar

Arnout Engelen raboof

View GitHub Profile
@raboof
raboof / CompileTimeFactorial.scala
Created March 24, 2016 19:06
Small Scala macros example: compile-time calculation of factorials
object CompileTimeFactorial {
import scala.language.experimental.macros
// This function exposed to consumers has a normal Scala type:
def factorial(n: Int): Int =
// but it is implemented as a macro:
macro factorial_impl
import scala.reflect.macros.blackbox.Context
@raboof
raboof / fixfontsizes.pl
Created May 21, 2016 17:40
Set terminal font size based on screen DPI
#!/usr/bin/perl
use strict;
use warnings;
my $windows = `wmctrl -l -G`;
my $processes = `ps faux`;
my $xrandr = `xrandr | grep " connected"`;
my @displays = ();
package playground
import scala.concurrent.duration._
import scala.concurrent.{ExecutionContext, Future}
import scala.util.{Failure, Success, Try}
import akka.actor.{Actor, ActorLogging, ActorRef, Props}
import akka.util.Timeout
import akka.pattern.{ask, pipe}
import playground.Parent.{BulkTasks, Finish, TaskCompleted, TaskFailed}
{ pkgs ? import <nixpkgs> {} }:
let
texlive = pkgs.texlive.combined.scheme-basic;
python = pkgs.python3;
textext = python.pkgs.buildPythonPackage rec {
pname = "textext";
version = "1.3.1";
src = pkgs.fetchFromGitHub {
owner = "textext";