This file contains hidden or 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
addEventListener('fetch', event => { | |
event.respondWith(handleRequest(event.request)) | |
}); | |
async function fetchImage(id, type = 'maxresdefault') { | |
const req = await fetch(`https://i.ytimg.com/vi/${id}/${type}.jpg`); | |
if (req.status != 200) return await fetchImage(id, 'hqdefault'); | |
return req; | |
}; |
This file contains hidden or 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.maple.kashin.learning | |
import androidx.appcompat.app.AppCompatActivity | |
import android.os.Bundle | |
import android.text.Html | |
import android.util.Log | |
import android.widget.Toast | |
import com.maple.kashin.databinding.ActivityChapterInfoBinding | |
import com.maple.kashin.learning.models.ChapterInfo | |
import com.maple.kashin.learning.models.QuranicChapterInfoResponseModel |
This file contains hidden or 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
// Load NavBar Image From Firebase | |
DatabaseReference getImage = databaseReferenceImage.child("NavBarImage"); | |
getImage.addListenerForSingleValueEvent(new ValueEventListener() { | |
@Override | |
public void onDataChange(@NonNull DataSnapshot dataSnapshot) { | |
// getting a DataSnapshot for the location at the specified | |
// relative path and getting in the link variable | |
String link = dataSnapshot.getValue(String.class); | |
// loading that data into rImage |
This file contains hidden or 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
public class Main { | |
public static void main(String[] args) { | |
// year to be checked | |
int year = 1996; | |
boolean leap = false; | |
// if the year is divided by 4 | |
if (year % 4 == 0) { |