This file contains 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
import 'package:flutter/material.dart'; | |
void main(){ | |
runApp( MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( |
This file contains 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
import 'package:flutter/material.dart'; | |
import 'package:network_connectivity_tut/check_connection.dart'; | |
import 'package:network_connectivity_tut/connectionType.dart'; | |
import 'package:internet_speed_test/internet_speed_test.dart'; | |
import 'package:internet_speed_test/callbacks_enum.dart'; | |
void main() { | |
runApp(MyApp()); | |
} |
This file contains 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
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { |
This file contains 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
import 'package:connectivity_plus/connectivity_plus.dart'; | |
import 'package:flutter/cupertino.dart'; | |
import 'package:flutter/material.dart'; | |
class ConnectionType extends StatefulWidget { | |
@override | |
_ConnectionTypeState createState() => _ConnectionTypeState(); | |
} | |
class _ConnectionTypeState extends State<ConnectionType> { |
This file contains 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
import 'package:flutter/material.dart'; | |
import 'package:internet_connection_checker/internet_connection_checker.dart'; | |
class CheckConnection extends StatefulWidget { | |
@override | |
_CheckConnectionState createState() => _CheckConnectionState(); | |
} | |
class _CheckConnectionState extends State<CheckConnection> { | |
@override |
This file contains 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
def latest_post(): | |
""" | |
returns the last modified post in posts directory | |
""" | |
posts_dic = dict() | |
for dirpath, dirnames, filenames in os.walk(posts_directory): | |
for dirname in dirnames: | |
posts_dic[dirname] = os.stat(dirpath+"/"+dirname).st_mtime | |
This file contains 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
def send_mail(email_content, latest_post_name): | |
""" | |
sends mail regarding latest posts to all the subscribers | |
""" | |
sender = "subscription@manavgarg.in" | |
message = EmailMessage() | |
message.set_content(email_content) | |
message["Subject"] = latest_post_name+" By Manav Garg" | |
message["From"] = sender |
This file contains 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
import os | |
from openpyxl import Workbook | |
# we're importing Workbook class from openpyxl module | |
source_location = "<by now you should know what goes here>" | |
searchString = "sha512WithECDSAEncryption" | |
servers = dict() | |
# A dictionary to keep track of my servers | |
# as you must remember dictionaries work with key:value pair | |
# so if my server supports sha512WithECDSAEncryption then |
This file contains 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
import os | |
source_location = "<location\\of\\the\\folder\\where\\configuration\\files\\are\\kept" | |
#Note how \\ is used. It is neccessary that you use \\ instead of \ for window file paths | |
searchString = "sha512WithECDSAEncryption" | |
def hasEncryption(file, encryptionString): | |
# this functions opens a single file and checks | |
# if the file has searchString that we're looking for |
This file contains 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
import os | |
source_location = "<location\\of\\the\\folder\\where\\configuration\\files\\are\\kept" | |
#Note how \\ is used. It is neccessary that you use \\ instead of \ for window file paths | |
#os.walk allows us to iterate through all the files and folder in the | |
#given location | |
for i in os.walk(source_location): | |
# What os.walk gives us in return is a list. | |
# That list has 3 elements |
NewerOlder