Skip to content

Instantly share code, notes, and snippets.

View iamnaran's full-sized avatar
🐧
git gitlich

Narayan Panthi iamnaran

🐧
git gitlich
View GitHub Profile
package com.template.androidtemplate.ui.photos.viewmodel
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.template.androidtemplate.data.helper.PreferencesHelper
import com.template.androidtemplate.data.model.Photos
import com.template.androidtemplate.data.repository.PhotosRepository
import com.template.androidtemplate.utils.NetworkHelper
@iamnaran
iamnaran / StoryResources.py
Created May 5, 2021 19:22
Upload multiple files & Save path to Database - Python Flask API
from flask import request, jsonify
from flask_restx import Resource, Namespace
from article import db, config
import uuid
import os
from werkzeug.utils import secure_filename
from flask import current_app
from flask_jwt_extended import (
verify_jwt_in_request,
@iamnaran
iamnaran / WeatherModel
Created May 15, 2021 14:07
Open Weather API Response
package com.template.bloomweather.model;
/*
This is a weather model auto generated from Open Weather API
*/
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class WeatherData {
@iamnaran
iamnaran / WeatherController.java
Last active May 17, 2021 14:45
WeatherController
package com.template.bloomweather.ui.main.controller;
import android.util.Log;
import androidx.annotation.NonNull;
import com.google.gson.GsonBuilder;
import com.template.bloomweather.constants.AppConstants;
import com.template.bloomweather.model.WeatherData;
import com.template.bloomweather.services.ApiClient;
@iamnaran
iamnaran / LocationPickerDialog.java
Last active May 15, 2021 14:22
Google Maps In Dialog Android. Display Maps In Android & Get Lat Lng
package com.template.bloomweather.ui.custom;
import android.Manifest;
import android.content.pm.PackageManager;
import android.location.Address;
import android.location.Geocoder;
import android.location.Location;
import android.location.LocationManager;
import android.os.Bundle;
import android.util.Log;
@iamnaran
iamnaran / GameOfThrone.json
Created May 20, 2021 17:02
Game Of Thrones JSON
[
{
"slug":"stark",
"name":"House Stark of Winterfell",
"members":[
{
"name":"Jon Snow",
"slug":"jon"
},
{
@iamnaran
iamnaran / GameOfThrones.kt
Created May 20, 2021 17:03
GamesOfThrone Model
data class GameOfThrones(
@SerializedName("members")
var members: List<Member>,
@SerializedName("name")
var name: String,
@SerializedName("slug")
var slug: String
) {
data class Member(
@SerializedName("name")
package com.template.androidtemplate.ui.home.viewmodel
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.template.androidtemplate.data.helper.PreferencesHelper
import com.template.androidtemplate.data.model.GameOfThrones
import com.template.androidtemplate.data.model.Photos
import com.template.androidtemplate.data.repository.HomeRepository
@iamnaran
iamnaran / ChildMembersAdapter.kt
Created May 21, 2021 06:06
Nested Recycler View Child Adapter
package com.template.androidtemplate.ui.home.adapter
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.template.androidtemplate.R
import com.template.androidtemplate.data.model.GameOfThrones
import kotlinx.android.synthetic.main.item_row_child.view.*
@iamnaran
iamnaran / ParentHouseAdapter.kt
Created May 21, 2021 06:14
Nested Recycler View Adapter Parent
package com.template.androidtemplate.ui.home.adapter
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.template.androidtemplate.R
import com.template.androidtemplate.data.model.GameOfThrones
import kotlinx.android.synthetic.main.item_row_parent.view.*