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 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
@xpepper
xpepper / from kotlin source to java execution of the generated bytecode.md
Last active May 25, 2019
from kotlin source to java execution of the generated bytecode
View from kotlin source to java execution of the generated bytecode.md

Write the simplest Kotlin file, and name it Main.kt:

fun main(args: Array<String>) {
    println("Hello world!")
}

Then compile the Kotlin file with kotlinc, which runs the Kotlin compiler

@xpepper
xpepper / Keeping a branch up-to-date with master.md
Last active May 21, 2019
Keeping a branch up-to-date with master
View Keeping a branch up-to-date with master.md

Keeping a branch up-to-date with master and then merge back the branch to master

git checkout new-feature # Go to the feature branch named "new-feature"
git rebase master

# Now your feature have all the commits from master!
@xpepper
xpepper / watching my train delay.md
Last active Apr 28, 2019
watching my train delay :-|
View watching my train delay.md
View java8app-run-on-jvm11.md

To have my Java8 app be able to be executed on a JVM Java11 I had to add this dependency to my build.gradle:

...
implementation 'org.glassfish.jaxb:jaxb-runtime'
...

Otherwise I got a runtime exception: java.lang.ClassNotFoundException: javax.xml.bind.JAXBContext

View java madness.md
brew java formula output
brew cask info java8 java8: 8u202
brew cask info adoptopenjdk/openjdk/adoptopenjdk8 adoptopenjdk8: 8,212:b03
brew cask info zulu8 zulu8: 8.0.212,8.38.0.13-ca
brew cask info corretto8 corretto8: 8.212.04.2
brew cask info java11 java11: 11.0.2,9
View kotlin.fun.kt
class ReceiptText(private val template: String) : (Int) -> String {
override fun invoke(price: Int): String {
return template.replace("%%%", price.toString())
}
}
val receiptText = ReceiptText("The total price to pay is %%% euro")
println(receiptText(10))
@xpepper
xpepper / Why It Doesn't Have to Be Crazy at Work.md
Created Mar 30, 2019
Why It Doesn't Have to Be Crazy at Work
View Why It Doesn't Have to Be Crazy at Work.md

David Heinemeier Hansson is the co-founder and CTO of Basecamp, a project management and team communication software designed to help teams work together calmly and productively.

David Heinemeier Hansson is the co-founder and CTO of Basecamp. He's the creator of the web application framework Ruby on Rails and has co-authored several books about remote work and the future of work, including REMOTE: Office Not Required and It Doesn't Have to Be Crazy at Work. In this interview, he speaks with Owl Labs about the future of work, why remote work will evolve to become the way business is done, and why ambition can be a weakness for some entrepreneurs, instead of a strength.

Owl Labs (OL): For those of our readers who aren't already familiar with your career, you created the web application framework Ruby on Rails, you're co-founder and CTO of Basecamp, and you've published several best-selling books, the most recent of which was It Doesn't Have to be Crazy at Work. My first question is, do you sleep? My second,

@xpepper
xpepper / Experimental_Generation_of_Interpersonal_Closeness.md
Last active Jan 9, 2019
Experimental_Generation_of_Interpersonal_Closeness.md
View Experimental_Generation_of_Interpersonal_Closeness.md

Experimental Generation of Interpersonal Closeness

See https://journals.sagepub.com/doi/pdf/10.1177/0146167297234003

Instructions to Subjects Included With Task Slips Packet

This is a study of interpersonal closeness, and your task, which we think will be quite enjoyable, is simply to get close to your partner. We believe that the best way for you to get close to your partner is for you to share with them and for them to share with you. Of course, when we advise you about getting close to your partner, we are giving advice regarding your behavior in this demonstration only, we are not advising you about your behavior outside of this demonstration.

In order to help you get close we've arranged for the two of you to engage in a kind of sharing game. You're sharing time will be for about one hour, after which time we ask you to fill out a questionnaire concerning your experience of getting close to your partner.

You can’t perform that action at this time.