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
// How to use For Loop in Nested Map | |
void main() { | |
var people = {1: {'Name': 'John', 'Age': '27', 'Sex': 'Male'}, | |
2: {'Name': 'Marie', 'Age': '22', 'Sex': 'Female'}}; | |
for(int i=1;i<=people.length;i++){ | |
print('\nPerson ID: ${i}'); | |
people[i].forEach((k,v)=>print('$k : $v')); | |
} |
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
[ | |
{ | |
"id": 1, | |
"firstname": "Emiline", | |
"lastname": "Carville", | |
"email": "[email protected]", | |
"gender": "Genderfluid", | |
"job": "Professor", | |
"phone": "638-170-8548", | |
"language": "Kazakh" |
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 'dart:convert'; | |
import 'dart:io'; | |
// This Will extract data from JSON file and Create CSV file. | |
// people.json DownloadLink : https://gist.githubusercontent.com/code-simple/dff6ec9eaa0816131d7273578f38c3e1/raw/6c8e8b9bb36003c2f3b9ca3cefc8a4bcfe2910eb/people.json | |
// new.csv DownloadLink : https://gist.githubusercontent.com/code-simple/7cae32a464f8a9995a6e510528edc576/raw/d31870b6dac5781ac4ee1d203e66334320bfec96/new.csv | |
void main() { | |
// Read CSV [Simple CSV that has first row header, and data in next rows] | |
List<Map<dynamic, dynamic>> readCSV(String fileName) { |
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
_ID | First Name | Last Name | Gender | Contact | Job | Language | ||
---|---|---|---|---|---|---|---|---|
1 | Tybi | Coskerry | [email protected] | Male | 0346-5735006 | Human Resources Assistant I | French | |
2 | Jerrie | Wakenshaw | [email protected] | Female | 0349-5138690 | Sales Associate | Chinese | |
3 | Matty | McCadden | [email protected] | Khusra | 0346-4564463 | Engineer IV | Swahili | |
4 | Darrick | Oultram | [email protected] | Male | 0339-6193663 | Teacher | Tswana | |
5 | Laverna | Wilcox | [email protected] | Male | 0327-9251003 | Sales Representative | Bosnian | |
6 | Elena | Pinder | [email protected] | Khusra | 0348-1525842 | Registered Nurse | Kurdish | |
7 | Tildie | Hefner | [email protected] | Khusra | 0339-5566900 | Editor | Bengali | |
8 | Manon | Tourot | [email protected] | Male | 0339-8781172 | General Manager | Czech | |
9 | Thorn | Gadesby | [email protected] | Male | 0349-4647773 | Director of Sales | Montenegrin |
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
// Test Code | |
// https://dartpad.dev/?id=b0c38822400ec328d396cba8e5f966bc | |
void main() { | |
mytime() { | |
var now = DateTime.now(); | |
var monthList = [ | |
// Added 1st month Null because of Range Error | |
'Null', |
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
void main() { | |
nextBirthDay({required int day, required int month, required int year}) { | |
var now = DateTime.now(); | |
var dob = DateTime(year,month,day); | |
var thisYearDob = DateTime(now.year,dob.month,dob.day); | |
return ('Next Birthday : ${thisYearDob.add(Duration(days:365)).toString().split(' ').first}'); | |
} | |
print(nextBirthDay(day:10,month:9,year:2021)); | |
} |
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
// FAB GROUP BUTTON EXAMPLE | |
import 'package:flutter/material.dart'; | |
import 'dart:math' as math; | |
void main() => runApp(MaterialApp( | |
home: App(), | |
debugShowCheckedModeBanner: false, | |
)); | |
class App extends StatefulWidget { |
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
#!/bin/bash | |
# This is example of how your can Webscrap using curl , Here i Webscraped my Gas and Electricity and Got all neccessary Information , Just change LINKS to get your corresponding bills to yours. | |
GASFILE='file:///tmp/gas.html' | |
GASLINK="https://www.sngpl.com.pk/web/viewbill?consumer=02613930003&proc=viewbill&contype=NewCon" | |
electricityLINK="https://bill.pitc.com.pk/pescobill/general?refno=08262140100430" | |
electricityFILE='/tmp/e.txt' | |
# TOOLS USED HERE: html2text - grep - wget | |
# Download and Convert ELECTRICTITY to Text electricity bill for easy extraction |
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
# This Python Script Scrapp PESCO Bill and Give all important information about Utility Bill | |
# Required modules BeautifulSoup & selenium , and Python 3.10 or latest | |
# To install modules write following command into Command | |
# e.g to install BeautifulSoup write in command 'pip install BeautifulSoup' | |
from bs4 import BeautifulSoup | |
from selenium import webdriver | |
from selenium.webdriver.firefox.options import Options | |
import re |
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
from bs4 import BeautifulSoup | |
import sys,requests,re,os | |
import pandas as pd | |
os.system('clear') | |
# Function to extract Product Title | |
def get_title(soup): |
OlderNewer