Skip to content

Instantly share code, notes, and snippets.

View sigmapie8's full-sized avatar
418

Manav sigmapie8

418
View GitHub Profile
@sigmapie8
sigmapie8 / main.dart
Created December 19, 2023 17:26
Chessboard with diagonal selection
import 'package:flutter/material.dart';
void main(){
runApp( MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
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());
}
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
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> {
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
@sigmapie8
sigmapie8 / last_modified.py
Created July 14, 2019 07:09
Sorting files on the basis of date modified
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
@sigmapie8
sigmapie8 / send_mail.py
Created July 14, 2019 07:02
sending emails through python
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
@sigmapie8
sigmapie8 / writing_excel.py
Last active May 6, 2019 20:25
writing_excel
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
@sigmapie8
sigmapie8 / searching_multiple_txt_files.py
Created May 6, 2019 19:37
searching_multiple_txt_files
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
@sigmapie8
sigmapie8 / recursing_folder.py
Created May 6, 2019 19:34
recursing_folder
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