Skip to content

Instantly share code, notes, and snippets.

View praharshbhatt's full-sized avatar
💙
Flutter

Praharsh Bhatt praharshbhatt

💙
Flutter
View GitHub Profile
@praharshbhatt
praharshbhatt / python_sitemap_extractor_script.py
Created May 25, 2023 18:14
This Python script scrapes a provided sitemap URL, extracts the URLs, and saves them in a CSV file. It supports both regular sitemaps and sitemap index files, allowing you to handle nested sitemaps effectively. The script utilizes the requests library for making HTTP requests and the BeautifulSoup library for XML parsing.
import requests
import csv
from bs4 import BeautifulSoup
from os.path import exists
def scrape_sitemap(url):
"""
Scrapes the provided sitemap URL and returns a list of extracted data.
Handles both regular sitemaps and sitemap index files.
@praharshbhatt
praharshbhatt / main.dart
Last active September 19, 2022 03:22
Flutter No fucks given
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
@praharshbhatt
praharshbhatt / full auth.dart
Last active June 22, 2021 04:48
Full Firebase Authentication for Flutter Mobile and web
import 'package:cloud_firestore/cloud_firestore.dart' as MobFirebaseFirestore;
import 'package:firebase/firebase.dart' as WebFirebase;
import 'package:firebase/firestore.dart' as WebFirestore;
import 'package:firebase_auth/firebase_auth.dart' as MobFirebaseAuth;
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/foundation.dart';
import 'package:google_sign_in/google_sign_in.dart';
import '../main.dart';
@praharshbhatt
praharshbhatt / homescreen.dart
Last active December 6, 2019 06:43
Contains a simple listview with a FloatingActionButton, where data gets added to the map when the button is clicked, and get uploaded to the database. Another raised button "Clear" clears it.
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:mobile_web_firebase/main.dart';
import 'package:mobile_web_firebase/screens/signin.dart';
import 'package:mobile_web_firebase/services/auth.dart';
//==================This is the Homepage for the app==================
String strAppBarTitle = "Healthstation Foundation";
class HomeScreen extends StatefulWidget {
@praharshbhatt
praharshbhatt / auth.dart
Last active December 6, 2019 06:34
Firebase Authentication class for Mobile Flutter
import 'package:cloud_firestore/cloud_firestore.dart' as MobFirebaseFirestore;
import 'package:firebase_auth/firebase_auth.dart' as MobFirebaseAuth;
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/foundation.dart';
import 'package:google_sign_in/google_sign_in.dart';
import '../main.dart';
MobFirebaseAuth.FirebaseUser firebaseUser;
//For storing user Profile info
@praharshbhatt
praharshbhatt / auth.dart
Created December 4, 2019 13:03
Firebase Authentication Functions for Flutter
import 'package:google_sign_in/google_sign_in.dart';
import 'package:firebase_auth/firebase_auth.dart';
//This contains actual user information
MobFirebaseAuth.FirebaseUser firebaseUser;
//This is the main Firebase auth object
MobFirebaseAuth.FirebaseAuth mobAuth = MobFirebaseAuth.FirebaseAuth.instance;
// For google sign in
final GoogleSignIn objGoogleSignIn = GoogleSignIn();