Skip to content

Instantly share code, notes, and snippets.

View gnsx's full-sized avatar

Kevin D'Souza gnsx

View GitHub Profile
/*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'
//Base example to use while multithreading in golang
package main
import (
"fmt"
)
func main() {
done := make(chan bool)
tasks := make(chan int64)
#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
package main
import "fmt"
//Point2D Structure
type Point2D struct {
x float64
y float64
}
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/
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
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"