Skip to content

Instantly share code, notes, and snippets.

View raphaeladrien's full-sized avatar

Raphael Adrien raphaeladrien

View GitHub Profile
@raphaeladrien
raphaeladrien / CSS-Responsive.markdown
Created March 31, 2014 18:23
A Pen by Raphael Adrien.
@raphaeladrien
raphaeladrien / DkFdy.markdown
Created March 31, 2014 22:26
A Pen by Raphael Adrien.
//TO CALL hotkeys( ALT, '1', function(){ alert('Hello Nurse!!!'); } );
const CTRL = 'ctrl+';
const ALT = 'alt+';
const CTRL_ALT = 'ctrl+alt+';
(function (window) {
'use strict';
const _hotkeys = {};

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:

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("-", "")
@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()
}
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 / 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)
@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
}
}
-server
-Xms2048m
-Xmx2048m
-XX:NewSize=512m
-XX:MaxNewSize=512m
-XX:PermSize=512m
-XX:MaxPermSize=512m
-XX:+UseParNewGC
-XX:ParallelGCThreads=4
-XX:MaxTenuringThreshold=1