Skip to content

Instantly share code, notes, and snippets.

View fida1989's full-sized avatar
😀
Hello World!

Fida Muntaseer fida1989

😀
Hello World!
View GitHub Profile
@fida1989
fida1989 / flutter-ci.yml
Created September 22, 2024 19:46 — forked from abdullahnettoor/flutter-ci.yml
Flutter - Build APK through GitHub Actions
name: Flutter CI
# This workflow is triggered on pushes to the repository.
on:
push:
branches:
- master
@fida1989
fida1989 / devops_youtube_resources.txt
Last active July 29, 2022 18:01
YOUTUBE LINKS TO LEARN DEVOPS
1) Linux :
Basic Linux commands are necessary before jumping into shell scripting.
* https://lnkd.in/dBTsJbhz
* https://lnkd.in/dHQTiHBB
* https://lnkd.in/dA9pAmHa
2. Shell Scripting:
* https://lnkd.in/da_wHgQH
import 'dart:convert';
class JWTUtils {
static final instance = JWTUtils();
Map<String, dynamic> parseJwt(String token) {
final parts = token.split('.');
if (parts.length != 3) {
throw Exception('invalid token');
@fida1989
fida1989 / jwt-payload-parse.dart
Created February 2, 2020 11:30 — forked from hjJunior/jwt-payload-parse.dart
Get payload of JWT token in Dart language
import 'dart:convert';
Map<String, dynamic> parseJwt(String token) {
final parts = token.split('.');
if (parts.length != 3) {
throw Exception('invalid token');
}
final payload = _decodeBase64(parts[1]);
final payloadMap = json.decode(payload);
class Manager private constructor(context: Context) {
init {
// Init using context argument
}
companion object : SingletonHolder<Manager, Context>(::Manager)
}
open class SingletonHolder<out T: Any, in A>(creator: (A) -> T) {
private var creator: ((A) -> T)? = creator
@Volatile private var instance: T? = null
fun getInstance(arg: A): T {
val i = instance
if (i != null) {
return i
}
@fida1989
fida1989 / GlobalGson.java
Created November 26, 2019 11:05
gson singelton
import androidx.annotation.NonNull;
import com.google.gson.Gson;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.ArrayList;
@fida1989
fida1989 / FusedLocationSingleton .java
Created March 31, 2019 08:25
FusedLocationSingleton
import android.annotation.SuppressLint;
import android.content.Intent;
import android.location.Location;
import android.os.Looper;
import android.support.v4.content.LocalBroadcastManager;
import com.easytransport.shuttle.driver.MyCustomApplication;
import com.easytransport.shuttle.driver.Utils.Constants;
import com.google.android.gms.location.FusedLocationProviderClient;
import com.google.android.gms.location.LocationCallback;
@fida1989
fida1989 / MapsActivity.kt
Last active March 31, 2019 06:56
MapsActivity
import android.Manifest
import android.annotation.SuppressLint
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.content.pm.PackageManager
import android.location.Location
import android.os.Bundle
import android.os.Handler
@fida1989
fida1989 / australian-postcodes.sql
Created March 18, 2019 19:39 — forked from randomecho/australian-postcodes.sql
Australian postcodes (with states and suburb names) geocoded with latitude and longitude.
/*
Taken and cribbed from blog.datalicious.com/free-download-all-australian-postcodes-geocod
May contain errors where latitude and longitude are off. Use at own non-validated risk.
*/
SET NAMES utf8;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
DROP TABLE IF EXISTS postcodes_geo;