Skip to content

Instantly share code, notes, and snippets.

💭
😏

Pietro Di Bello xpepper

💭
😏
Block or report user

Report or block xpepper

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View design-pattern-observer-java.md

What is a Design Pattern?

Every Software Engineer certainly must have to deal with change. Change is a constant in Software Design: adding feature, changing of requirement or bug fixing.

What is a design pattern? In simplest way I can say, it is a general solution for common problems in Software Development. The purpose of design patterns is to help structure your code so it will be flexible and resilient when its changed.

There are 23 common design patterns that are being used by programmers around the world. In this chapter I am going to describe the Observer Pattern.

Introduction to Observer Pattern

View practical example of a jacoco execution.groovy
post {
always {
archiveArtifacts artifacts: '**/build/libs/*.war', onlyIfSuccessful: true
jacoco(
classPattern: '**/classes/kotlin/main',
sourcePattern: '**/src/main/kotlin',
sourceInclusionPattern: '**/*.kt'
)
}
success {
View jacoco-pipeline.groovy
// inside a step in the Jenkinsfile...
...
 jacoco(
  classPattern: '**/classes/kotlin/main',
  sourcePattern: '**/src/main/kotlin',
  sourceInclusionPattern: '**/*.kt'
 )
...
View build folder.md
build/
    classes
          kotlin
    jacoco
          test.exec
    reports
          jacoco
View build folder.md
build/
    classes
          kotlin
    jacoco
          test.exec
    ...          
@xpepper
xpepper / Adding Jacoco code coverage measurement to a Kotlin Gradle project (and then adding coverage reports on a Jenkins pipeline).md
Created Oct 13, 2019
Adding Jacoco code coverage measurement to a Kotlin Gradle project (and then adding coverage reports on a Jenkins pipeline)
View Adding Jacoco code coverage measurement to a Kotlin Gradle project (and then adding coverage reports on a Jenkins pipeline).md

Add code coverage to a gradle project

In order to have code coverage measurement enabled on your gradle project, you have to just add the jacoco plugin to the build.gradle plugin section

plugins {
    ...
    id 'jacoco'
}
@xpepper
xpepper / jbrains.md
Created Aug 18, 2019
What your tests don’t need to know will hurt you
View jbrains.md
View learning-javascript.md

Before to start

In JavaScript there is NO concept of Class.

Everything is an Object.

Inheritance between objects is achieved with a mechanism known as Prototypal Inheritance.

We can create Objects and then link them together OLOO (Objects-Linked-to-Other-Objects).

View Kotlin Scope Functions.md
// it's NOT an extension function
// it takes the receiver and a lambda with the same receiver
// it returns the result of the lambda on the implicit receiver
inline fun <T, R> with(receiver: T, block: T.() -> R): R {
    return receiver.block()
}

with ("ciao") {
    length + 1
You can’t perform that action at this time.