Skip to content

Instantly share code, notes, and snippets.

View raphaeladrien's full-sized avatar

Raphael Adrien raphaeladrien

View GitHub Profile
.gradle
/build/
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
@raphaeladrien
raphaeladrien / two-sum.md
Last active October 16, 2021 22:03
Two sum

Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.

You may assume that each input would have exactly one solution, and you may not use the same element twice.

You can return the answer in any order.

Solution:

var twoSum = function(nums, target) {
#List all Docker Images
docker images -q
#Removing Docker Image or images
// to remove one specific image
docker rm image1
// to remove two (more) specific images, just mention list
docker rm image1 image2
#Removing All Docker Image
docker rmi $(docker images -q)
#Remove a container(s)
-server
-Xms2048m
-Xmx2048m
-XX:NewSize=512m
-XX:MaxNewSize=512m
-XX:PermSize=512m
-XX:MaxPermSize=512m
-XX:+UseParNewGC
-XX:ParallelGCThreads=4
-XX:MaxTenuringThreshold=1
@raphaeladrien
raphaeladrien / example.txt
Created November 12, 2018 15:09
Gradle add http/2 + spring boot
tasks.withType(JavaExec) {
doFirst {
jvmArgs += '-Xbootclasspath/p:' + projectDir + File.separator + 'alpn-boot-8.1.11.v20170118.jar'
println jvmArgs
println commandLine
}
}
@raphaeladrien
raphaeladrien / docker-clean.sh
Created May 28, 2018 10:43
Destroy all images and containers of docker
#!/bin/bash
# Delete all containers
docker rm $(docker ps -a -q)
# Delete all images
docker rmi $(docker images -q)
export const retryFetch = (url, options, retryConf = {maxRetries: 2, delay: 200}) => {
return new Promise((resolve, reject) => {
const wrappedFetch = ({maxRetries, delay}) => {
fetch(url, options)
.then(response => {
const status = response.status
if (status >= 500) {
if (maxRetries > 0) {
retry(maxRetries, delay)
} else {
@raphaeladrien
raphaeladrien / build.gradle
Last active May 17, 2018 11:14
Example gradle kotlin + spring boot
buildscript {
ext {
kotlin_version = '1.2.41'
spring_boot_version = '2.0.1.RELEASE'
mockito_kotlin_version = '1.5.0'
}
repositories {
mavenCentral()
}
fun main(args: Array<String>) {
if(isValid(args[0])) {
println("Thanks, the CPF informed is valid")
} else {
println("Please, inform a valid CPF.")
}
}
fun isValid(cpf: String): Boolean {
val formattedCPF = cpf.replace(".", "").replace("-", "")

Keybase proof

I hereby claim:

  • I am raphaeladrien on github.
  • I am raphaeladrien (https://keybase.io/raphaeladrien) on keybase.
  • I have a public key ASCxWb4T4_zK8oZ7DLMpXy58KiTrMvrxlu2LkhIF1hK1jQo

To claim this, I am signing this object: