Skip to content

Instantly share code, notes, and snippets.

View luiszacheu's full-sized avatar

Luís Gustavo Verri Zacheu luiszacheu

View GitHub Profile
@luiszacheu
luiszacheu / ListFromJson.kt
Created October 28, 2019 18:44
Gson FromJson List (Kotlin)
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 June 22, 2017 13:21 — forked from vcavallo/version.rake
Manage your rails app version with this rake task
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
git checkout [branch_derivada_da_master]
git -s ours master
git checkout master
git merge [branch_derivada_da_master]
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'