Skip to content

Instantly share code, notes, and snippets.

View BraisGabin's full-sized avatar

Brais Gabín BraisGabin

  • Barcelona (Spain)
View GitHub Profile
@BraisGabin
BraisGabin / updateDetekt.sh
Last active December 22, 2020 10:12
Update detekt configuration
#!/usr/bin/env bash
mv config/detekt/detekt.yml config/detekt/detekt.yml.old
./gradlew detektGenerateConfig
diff config/detekt/detekt.yml config/detekt/detekt.yml.old >config/detekt/detekt.patch
read -p "Update detekt and then press ENTER" ignore
rm config/detekt/detekt.yml
./gradlew detektGenerateConfig
patch config/detekt/detekt.yml --no-backup-if-mismatch --merge <config/detekt/detekt.patch
rm config/detekt/detekt.patch
@BraisGabin
BraisGabin / Feature.kt
Created September 23, 2019 08:37
An implementation of MVI inspired by MVICore by Badoo
package com.b21
import com.jakewharton.rxrelay2.PublishRelay
import com.jakewharton.rxrelay2.Relay
import io.reactivex.BackpressureStrategy
import io.reactivex.Flowable
import io.reactivex.functions.Consumer
import org.reactivestreams.Subscriber
/**
@BraisGabin
BraisGabin / CPM.java
Last active August 29, 2016 11:53
[Pokémon GO] Simple script to get a table with all the CP Multipliers
public class CPM {
public static void main(String[] args) {
// Extracted from:
// https://www.reddit.com/r/pokemongodev/comments/4t59t1/decoded_game_master_protobuf_file_v01_all_pokemon/d5f2y91
float[] cpm = {
0.094f, 0.16639787f, 0.21573247f, 0.25572005f, 0.29024988f,
0.3210876f, 0.34921268f, 0.37523559f, 0.39956728f, 0.42250001f,
0.44310755f, 0.46279839f, 0.48168495f, 0.49985844f, 0.51739395f,
0.53435433f, 0.55079269f, 0.56675452f, 0.58227891f, 0.59740001f,