Skip to content

Instantly share code, notes, and snippets.

Avatar

luiszacheu

  • Santander Tecnologia
  • São Paulo, Brazil
View GitHub Profile
@luiszacheu
luiszacheu / ListFromJson.kt
Created Oct 28, 2019
Gson FromJson List (Kotlin)
View ListFromJson.kt
val gson = Gson()
val jsonString = gson.toJson(list)
val listType = object : TypeToken<List<String>>() { }.type
val newList = gson.fromJson<List<String>>(jsonString, listType)
@luiszacheu
luiszacheu / version.rake
Created Jun 22, 2017 — forked from vcavallo/version.rake
Manage your rails app version with this rake task
View version.rake
def valid? version
pattern = /^\d+\.\d+\.*\d*(\-(dev|beta|rc\d+))?$/
raise "Tried to set invalid version: #{version}".red unless version =~ pattern
end
def correct_version version
ver, flag = version.split '-'
v = ver.split '.'
(0..2).each do |n|
v[n] = v[n].to_i
View SobreporBranchDerivadaDaMasterNaMaster
git checkout [branch_derivada_da_master]
git -s ours master
git checkout master
git merge [branch_derivada_da_master]
View build.gradle
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'