Skip to content

Instantly share code, notes, and snippets.

Minimalism is Power!

Rafael Topera topera

Minimalism is Power!
  • Brazil
View GitHub Profile
topera /
Created Mar 10, 2019
Example of unit test of Android presenters (MVP architecture)
public class WordPresenterTest {
WordPresenter.View view;
WordService wordService;
private WordPresenter presenter;
topera / bitbucket-pipelines.yml
Created Jan 5, 2019
Bitbucket pipelines to run unit tests
View bitbucket-pipelines.yml
image: java:8
- step:
- gradle
- bash ./gradlew test
topera /
Created Jul 8, 2018
Controller for springboot that redirects any url to /
public class ForwardingController {
public String forward() {
// path: checks only the path of url
// [^\.]: any char, except literal dot (because if the url is foo.css (for example) we don't want to redirect)
return "forward:/";
topera / Jenkinsfile
Created Jul 7, 2018
Example of basic Jenkinspipeline
View Jenkinsfile
pipeline {
agent {
any {}
stages {
stage('setup') {
steps {
sh './gradlew tasks'
topera / .travis.yml
Created Jul 1, 2018
Example of travis YAML file, using Gradle and SASS
View .travis.yml
sudo: required # need by docker
dist: trusty
group: travis_lts # travis_lts (stable) vs travis_latest (more features-fixes)
language: java
- oraclejdk8
topera / fobit-aws.gradle
Created Jun 29, 2018
Gradle file with many options to deploy on AWS Elastic Beanstalk
View fobit-aws.gradle
import com.terahorse.gradle.AWS
import com.terahorse.gradle.SimpleExec
def group = 'fobit-aws'
task setupFobitPackage(type: SimpleExec, group: group) {
description 'Creates a simple package for AWS EB. This package contains only'
doFirst {
run "cp"
topera / build.gradle
Last active Jun 28, 2018
How to run gradle tasks in sequence in a easy way
View build.gradle
Task.metaClass.runFirst = { Task... others ->
for (def i=0; i < others.size() - 1; i++) {
def before = others[i]
def after = others[i+1]
topera /
Last active Jun 26, 2018
How to run SASS inside Travis CI

SASS Inside Travis CI

Working Solution

I was able to run it installing npm and then installing sass package of npm. I needed also to add a workaround to Error: CERT_UNTRUSTED error, using the config set registry command.

  - sudo apt update
  - sudo apt install npm
topera /
Last active Jun 26, 2018
How to run Travis-CI locally
topera / dependencies.gradle
Created Jun 25, 2018
How to make Spring Boot reload changed java code. Just change the code and call "gradle assemble"
View dependencies.gradle
// spring: allow automatic restart
compile "org.springframework.boot:spring-boot-devtools:2.0.3.RELEASE"