Skip to content

Instantly share code, notes, and snippets.

@juanrh
juanrh / Consumer.scala
Created May 14, 2016 04:24
Raw dependency injection in Scala emulating modules with implicit objects
package com.github.juanrh.di
/* The consumer class declares its dependencies as
* implicit parameters in the constructor
* */
class Consumer(implicit private[this] val dep: Dependency) {
def hello(): Unit = println(dep.sayHello("world"))
}
/* This trait declares which dependencies (analogous to beans)
@juanrh
juanrh / vcs_export_ros1_bridge-174.txt
Created March 26, 2019 17:56
vcs_export_ros1_bridge-174.txt
repositories:
src/ament/ament_cmake:
type: git
url: https://github.com/ament/ament_cmake.git
version: d1d73ed440822543981df1f663ee2ed3a023dd40
src/ament/ament_index:
type: git
url: https://github.com/ament/ament_index.git
version: 2ae14036e2c4f9db6fce022a47e300f71c47ea64
src/ament/ament_lint:
@juanrh
juanrh / vcs_export_rcl_interfaces-67.txt
Created March 26, 2019 17:58
vcs_export_rcl_interfaces-67.txt
repositories:
src/ament/ament_cmake:
type: git
url: https://github.com/ament/ament_cmake.git
version: d1d73ed440822543981df1f663ee2ed3a023dd40
src/ament/ament_index:
type: git
url: https://github.com/ament/ament_index.git
version: 2ae14036e2c4f9db6fce022a47e300f71c47ea64
src/ament/ament_lint:
repositories:
ament/ament_cmake:
type: git
url: https://github.com/ament/ament_cmake.git
version: master
ament/ament_index:
type: git
url: https://github.com/ament/ament_index.git
version: master
ament/ament_lint:
@juanrh
juanrh / ConcurrentActionsTest.scala
Created April 8, 2019 01:40
Exceptions when launching counts on a Flink DataSet concurrently
package es.ucm.fdi.sscheck.flink.demo.pollution
import java.util.concurrent.Executors
import org.apache.flink.api.scala._
import org.junit.runner.RunWith
import org.specs2.Specification
import org.specs2.runner.JUnitRunner
import org.specs2.matcher.ResultMatchers
@juanrh
juanrh / ROS2_Docker_basics.sh
Created February 7, 2020 15:19
ROS2 Docker basics
# https://docs.docker.com/install/linux/docker-ce/ubuntu/
# https://docs.docker.com/install/linux/linux-postinstall/
docker run -it ubuntu:bionic bash
docker run -it ros:dashing bash
ros2 node list
sudo apt update
sudo apt install ros-dashing-demo-nodes-cpp