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 | |
import boto3 | |
from botocore.exceptions import ClientError | |
from email.mime.multipart import MIMEMultipart | |
from email.mime.text import MIMEText | |
from email.mime.application import MIMEApplication | |
# Setup the basics here | |
SENDER = "[email protected]" | |
RECIPIENT = "[email protected]" | |
SUBJECT = "Customer service contact info" |
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
mkdir nominatimdata | |
cd nominatimdata | |
wget https://download.geofabrik.de/asia/sri-lanka-latest.osm.pbf | |
wget https://download.geofabrik.de/asia/india-latest.osm.pbf | |
wget https://download.geofabrik.de/asia/bangladesh-latest.osm.pbf | |
wget https://download.geofabrik.de/asia/nepal-latest.osm.pbf | |
osmconvert bangladesh-latest.osm.pbf --out-o5m | osmconvert - nepal-latest.osm.pbf -o=bang-nep.pbf | |
osmconvert bang-nep.pbf --out-o5m | osmconvert - sri-lanka-latest.osm.pbf -o=bang-nep-sl.pbf |
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
Understand What is Programming | |
https://www.futurelearn.com/courses/programming-101/0/steps/43783 | |
Further Reading | |
Data Types: https://en.wikipedia.org/wiki/Data_type | |
Data Structures: https://www.geeksforgeeks.org/data-structures/ | |
What are programming languages | |
https://www.geeksforgeeks.org/introduction-to-programming-languages/ |
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
package main | |
import "fmt" | |
//Point2D Structure | |
type Point2D struct { | |
x float64 | |
y float64 | |
} |
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
#for python 2.7 | |
#!/usr/bin/env python | |
""" | |
Extract all attachments from '.eml' file EML_FILE into | |
directory OUTPUT_DIR. If OUTPUT_DIR does not exist, it will be | |
created. | |
Usage: extract_attachments.py EML_FILE OUTPUT_DIR | |
""" | |
import sys | |
import os |
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
//Base example to use while multithreading in golang | |
package main | |
import ( | |
"fmt" | |
) | |
func main() { | |
done := make(chan bool) | |
tasks := make(chan int64) |
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
/*Athena Query to get data between dates using epoch for timestamp*/ | |
SELECT distinct(unique_id) AS unique_id , | |
second_field | |
FROM "table_name" | |
WHERE from_unixtime(epoch_time,'Asia/Kolkata') < (CURRENT_DATE - interval '1' DAY) | |
AND from_unixtime(epoch_time,'Asia/Kolkata') > (CURRENT_DATE - interval '2' DAY) | |
AND second_field = 'UPLIFTED' |
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
package main | |
import ( | |
b64 "encoding/base64" | |
"fmt" | |
"io/ioutil" | |
"os" | |
) | |
func main() { |
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
//Sort implementation for custom types | |
// Encapsulates the statistical data that CloudWatch computes from metric data. | |
type Datapoint struct { | |
_ struct{} `type:"structure"` | |
// The average of the metric values that correspond to the data point. | |
Average *float64 `type:"double"` | |
// The percentile statistic for the data point. | |
ExtendedStatistics map[string]*float64 `type:"map"` |
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 "sort" | |
ages := map[string]int{ | |
"a": 1, | |
"c": 3, | |
"d": 4, | |
"b": 2, | |
} | |
names := make([]string, 0, len(ages)) |
NewerOlder