Skip to content

Instantly share code, notes, and snippets.

View claudio-scandura's full-sized avatar

Claudio Scandura claudio-scandura

View GitHub Profile

Keybase proof

I hereby claim:

  • I am claudio-scandura on github.
  • I am claudioscandura (https://keybase.io/claudioscandura) on keybase.
  • I have a public key ASDNieYGl96RXIlXcbd2aiJBysav0RZAuTYTf1h8tqh_fQo

To claim this, I am signing this object:

@claudio-scandura
claudio-scandura / aliases
Created June 28, 2018 10:18
Useful aliases
alias git-clean-branches='git branch --merged | grep -v -e master -e "*" | xargs git branch -d'
alias docker-cleanup='docker rm -fv $(docker ps -a -q -f status=exited)'
alias docker-killall='docker rm -fv $(docker ps -qa)'
@claudio-scandura
claudio-scandura / bash_profile
Created May 21, 2018 08:18
Sample bash profile
shopt -s dotglob # ls dir/* includes dotfiles
export GIT_EDITOR=vim
# Shell prompt
#if [ -f fancy_git_prompt.sh ]; then
#. fancy_git_prompt.sh
#fi
@claudio-scandura
claudio-scandura / vimrc
Created January 30, 2018 10:44
Vim profile settings
" Use Vim settings, rather then Vi settings (much better!).
" This must be first, because it changes other options as a side effect.
set nocompatible
" ================ General Config ====================
set number "Line numbers are good
set backspace=indent,eol,start "Allow backspace in insert mode
set history=1000 "Store lots of :cmdline history
set showcmd "Show incomplete cmds down the bottom
@claudio-scandura
claudio-scandura / SseApp.scala
Last active June 10, 2021 12:22
Akka-http example of SSE using an Actor as the source of the events Stream.
import akka.actor.{Actor, ActorSystem, Props}
import akka.http.scaladsl.Http
import akka.http.scaladsl.model.StatusCodes
import akka.http.scaladsl.model.sse.ServerSentEvent
import akka.http.scaladsl.server.Directives._
import akka.http.scaladsl.server.Route
import akka.stream._
import akka.stream.scaladsl.{BroadcastHub, Keep, Source, SourceQueueWithComplete}
import scala.concurrent.ExecutionContext.Implicits.global
@claudio-scandura
claudio-scandura / sudokuBoard.scala
Created August 5, 2017 08:03
Bored on the plane without sudoku I thought of writing my own board.
class SudokuBoard {
val size = 9
private val sudokuRange = 0 until size
val board = sudokuRange.map { _ =>
sudokuRange.map(_ => 'E').toArray
}.toArray
def stringify = board.map(_.mkString("[", ", ", "]")).mkString("\n")
def assign(row: Int, column: Int, value: Char) =