Skip to content

Instantly share code, notes, and snippets.

View miguelbaldi's full-sized avatar

Miguel Aranha Baldi Horlle miguelbaldi

View GitHub Profile
@urcadox
urcadox / Filters.scala
Created November 18, 2016 11:30
Play 2.5 HTTPS redirection on Clever Cloud
package controllers
import javax.inject._
import play.api._
import play.api.http.DefaultHttpFilters
import play.api.mvc._
import play.api.Environment
import scala.concurrent.{ExecutionContext, Future}
import akka.stream.Materializer
@searler
searler / FSMTCPClient.scala
Created July 18, 2015 20:58
Simple request/response TCP client using AKKA streams and FSM
package io
import scala.concurrent.duration.DurationInt
import scala.util.Success
import akka.actor.ActorRef
import akka.actor.ActorSystem
import akka.actor.FSM
import akka.actor.PoisonPill
import akka.actor.Props
@rubencaro
rubencaro / install_elixir.md
Last active September 30, 2023 03:58
Elixir installation guide

Elixir installation guide

Version numbers should be the ones you want. Here I do it with the last ones available at the moment of writing.

The simplest way to install elixir is using your package manager. Sadly, at the time of writing only Fedora shows the intention to keep its packages up to date. There you can simply sudo dnf install erlang elixir and you are good to go.

Anyway, if you intend to work with several versions of erlang or elixir at the same time, or you are tied to a specific version, you will need to compile it yourself. Then asdf is your best friend.

@kdambekalns
kdambekalns / patchset-created
Last active August 20, 2020 05:15
Gerrit commit message check hook
#!/bin/bash
BASE="/home/gerrit/review/git"
while [ "$1" != "" ]; do
case $1 in
--change) CHANGE=$2; shift;;
--project) PROJECT=$2; shift;;
--branch) BRANCH=$2; shift;;
--uploader) UPLOADER=$2; shift;;
@vrischmann
vrischmann / .credentials
Last active January 20, 2023 11:57
Running SBT with a Nexus proxy with authentication
realm=Sonatype Nexus Repository Manager
host=nexus.company.com
user=admin
password=admin123
@stevenrombauts
stevenrombauts / progressbar.sh
Created February 26, 2014 14:37
Bash Progress Bar
#!/bin/bash
# Slick Progress Bar
# Created by: Ian Brown ([email protected])
# Please share with me your modifications
# Note: From http://stackoverflow.com/questions/11592583/bash-progress-bar
# Functions
PUT(){ echo -en "\033[${1};${2}H";}
DRAW(){ echo -en "\033%";echo -en "\033(0";}
WRITE(){ echo -en "\033(B";}
HIDECURSOR(){ echo -en "\033[?25l";}
@myobie
myobie / mountain-lion-brew-setup.markdown
Created February 18, 2012 20:14
Get Mountain Lion and Homebrew to Be Happy

Get Mountain Lion and Homebrew to Be Happy

1) Install XCode 4.4 into /Applications

Get it from the App Store.

2) Install Command Line Tools

In XCode's Preferences > Downloads you can install command line tools.

@derekwyatt
derekwyatt / ReqRspActor.scala
Created May 3, 2011 16:00
A simple Request/Response one-shot Akka Actor example
object ReqRspActor {
object ReqRspProtocol {
case class UnknownMessage(msg: String) extends Exception(msg)
case class FutureException(exception: Throwable)
}
object ResendOrNot extends Enumeration {
type ResendOrNot = Value
val Resend, DoNotResend = Value
}