This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Context | |
import android.os.Build | |
import android.os.UserManager | |
// Enum to represent the user profile types | |
enum class UserProfile { | |
MAIN_USER, | |
MANAGED_PROFILE, | |
OTHER_PROFILE, | |
UNKNOWN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ "urlname": "YOUR URL PATH here, for https://www.meetup.com/swmobile the urlname is swmobile" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.assertj.core.api.AbstractObjectAssert | |
@Suppress("UNCHECKED_CAST") | |
inline fun <reified R> AbstractObjectAssert<*, *>.isNotInstanceOf(): AbstractObjectAssert<*, *>? = | |
isNotInstanceOf(R::class.java) | |
@Suppress("UNCHECKED_CAST") | |
inline fun <reified R> AbstractObjectAssert<*, *>.isInstanceOf(): AbstractObjectAssert<*, *>? = | |
isInstanceOf(R::class.java) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ${PACKAGE_NAME} | |
import com.nhaarman.mockitokotlin2.verify | |
import com.nhaarman.mockitokotlin2.whenever | |
import org.assertj.core.api.Assertions.assertThat | |
import org.junit.Before | |
import org.junit.Test | |
import org.junit.runner.RunWith | |
import org.mockito.Mock | |
import org.mockito.junit.MockitoJUnitRunner |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Deploy to Firebase | |
'on': | |
push: | |
branches: | |
- main | |
jobs: | |
build_and_deploy: | |
name: Build and deploy Jekyll site | |
runs-on: ubuntu-latest | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyAppFirebaseMessagingService : FirebaseMessagingService() { | |
override fun onMessageReceived(remoteMessage: RemoteMessage) { | |
if(remoteMessage.data.isNotEmpty()) { | |
processNewMessage(remoteMessage.data) | |
} | |
} | |
private fun processNewMessage(remoteMessageData: Map<String, String>) { | |
if (BeaconPushNotificationsProcessor.isBeaconNotification(remoteMessageData)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.scottyab.whatsnewplayground.data | |
import android.content.Context | |
import android.content.SharedPreferences | |
import androidx.security.crypto.EncryptedSharedPreferences | |
import androidx.security.crypto.MasterKeys | |
import com.scottyab.whatsnewplayground.BuildConfig | |
internal class SampleEncPrefs(context: Context) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package me.angrybyte.coloringdemo; | |
import static android.graphics.PorterDuff.Mode.SRC_ATOP; | |
import android.annotation.SuppressLint; | |
import android.annotation.TargetApi; | |
import android.content.Context; | |
import android.content.res.ColorStateList; | |
import android.graphics.Bitmap; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# exit if fails | |
set -o errexit | |
set -o pipefail | |
# reads the first arg as the file - expected list of file names without extension | |
filename="${1:-}" | |
# loops through each line | |
while read -r line |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
# coding: utf-8 | |
"""This script reads all .java and .kt files from a directory tree and determines if | |
it's necessary to write a Copyright Notice in the beginning of each Java file. | |
It checks that by searching for the word "copyright" in the first few lines. | |
Warning: use it at your own risk. Better have a source control to rollback if | |
necessary. | |
""" |
NewerOlder