Skip to content

Instantly share code, notes, and snippets.

View ibrahimsn98's full-sized avatar

İbrahim Süren ibrahimsn98

View GitHub Profile
implementation "com.company.project:artifact:1.0.0-SNAPSHOT"
allprojects {
repositories {
google()
jcenter()
...
maven {
url "https://gitlab.com/api/v4/projects/projectid/packages/maven"
name "GitLab"
credentials(HttpHeaderCredentials) {
name = 'Private-Token'
apply from: "$rootDir/gradle-mvn-push.gradle"
buildscript {
...
}
plugins {
id 'maven-publish'
}
allprojects {
...
apply plugin: 'maven-publish'
static def isReleaseBuild() {
return !Config.versionName.contains("SNAPSHOT")
}
def getOutputDir() {
if (isReleaseBuild()) {
return "${project.buildDir}/releases"
} else {
( printf "\x1f\x8b\x08\x00\x00\x00\x00\x00" ; tail -c +25 cat.ab ) | tar xfvz -
@ibrahimsn98
ibrahimsn98 / AdbCommands
Created March 10, 2019 14:15 — forked from Pulimet/AdbCommands
Adb useful commands list
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
== Shell
@ibrahimsn98
ibrahimsn98 / jwt-expiration.md
Created February 8, 2019 13:18 — forked from soulmachine/jwt-expiration.md
How to deal with JWT expiration?

First of all, please note that token expiration and revoking are two different things.

  1. Expiration only happens for web apps, not for native mobile apps, because native apps never expire.
  2. Revoking only happens when (1) uses click the logout button on the website or native Apps;(2) users reset their passwords; (3) users revoke their tokens explicitly in the administration panel.

1. How to hadle JWT expiration

A JWT token that never expires is dangerous if the token is stolen then someone can always access the user's data.

Quoted from JWT RFC:

@ibrahimsn98
ibrahimsn98 / MainActivity.kt
Last active January 1, 2019 09:56
Android-Live-Shared-Preferences-Gist8
liveSharedPreferences.listenMultiple(listOf("bool1", "bool2", "bool3"), false).observe(this, Observer<Pair<String, Boolean>> { value ->
Log.d(TAG, "key: ${value!!.first} value: ${value.second}")
})
@ibrahimsn98
ibrahimsn98 / LiveSharedPreferences.kt
Created December 31, 2018 20:02
Android-Live-Shared-Preferences-Gist7
public fun <T> listenMultiple(keys: List<String>, defaultValue: T): MultiPreference<T> {
return MultiPreference(updates, preferences, keys, defaultValue)
}