Skip to content

Instantly share code, notes, and snippets.

View firecatmusic's full-sized avatar
💤

Ade Fajar firecatmusic

💤
View GitHub Profile
@firecatmusic
firecatmusic / ExitActivity.kt
Created December 21, 2018 05:45
Easily OnBackPressed
class ExitActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
finish()
}
companion object {
fun exit(context: Context) {
class FCMService2 : FirebaseMessagingService() {
private var pendingIntent: PendingIntent? = null
override fun onMessageReceived(remoteMessage: RemoteMessage?) {
Log.e("get_type_data", remoteMessage!!.data.toString())
createNotification(remoteMessage.data)
}
private fun createNotification(messageBody: Map<String, String>) {
private var connectionReceiver: ConnectionReceiver? = null
override fun onStart() {
super.onStart()
connectionReceiver = ConnectionReceiver()
registerReceiver(connectionReceiver, IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION))
}
override fun onStop() {
try {
lateinit var manager: ReviewManager
var reviewInfo: ReviewInfo? = null
// Call this method asap, for example in onCreate()
private fun initReviews() {
manager = ReviewManagerFactory.create(this)
manager.requestReviewFlow().addOnCompleteListener { request ->
if (request.isSuccessful) {
reviewInfo = request.result
} else {
@firecatmusic
firecatmusic / DateUtil.kt
Created October 10, 2022 07:04
Date class helper
import org.junit.Test
import java.time.DayOfWeek
import java.time.LocalDateTime
import java.time.LocalTime
import java.time.ZoneId
import java.time.format.DateTimeFormatter
import java.time.temporal.TemporalAdjusters
import java.util.*
class DateUtil {
@firecatmusic
firecatmusic / Auto Accept Invite.lua
Created January 3, 2023 08:17
a simple lua auto accept invite party for gamesense.pub
local panorama = panorama.open()
local partyBrowserApi = panorama.PartyBrowserAPI
local gameApi = panorama.GameStateAPI
local competitiveMatchApi = panorama.CompetitiveMatchAPI
local partyListApi = panorama.PartyListAPI
local friendsListApi = panorama.FriendsListAPI
local lobbyApi = panorama.LobbyAPI
local labelStart = ui.new_label("LUA", "B", "----------- Derank -----------")