Skip to content

Instantly share code, notes, and snippets.

View amulya349's full-sized avatar
🎯
Focusing

Amulya Kumar Sahoo amulya349

🎯
Focusing
View GitHub Profile
@amulya349
amulya349 / copy_csv_to_db.py
Created September 10, 2018 10:35
This script can be used to copy a CSV file (with header) to a Postgres remote database.
#!/usr/bin/env/python
import psycopg2
# Get a database connection
dsn = "dbname=%s user=%s password=%s host=%s port=%s" % ('db_name','username','password','remote_host_ip','port')
conn = psycopg2.connect(dsn)
query = "COPY public.hiringpattern_new FROM stdin WITH CSV HEADER DELIMITER as ',' "
fp = open('csv_file_path', 'r')
for(var i=0; i<input.length; i++){
var somepath = decodePolyline(input[i].polyline)
var spath = []
for(var i=0; i<somepath.length; i++){
spath.push(new google.maps.LatLng(somepath[i].latitude, somepath[i].longitude));
}
var cascadiaFault = new google.maps.Polyline({
path: spath
});
@amulya349
amulya349 / iislocationneartheone.html
Created May 5, 2016 16:55
see from line 95 to 107.. That contains the added code
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<title>Directions service</title>
<script src="https://code.jquery.com/jquery-2.2.3.min.js"></script>
<style>
html, body {
height: 100%;
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<title>Directions service</title>
<script src="https://code.jquery.com/jquery-2.2.3.min.js"></script>
<style>
html, body {
height: 100%;
@amulya349
amulya349 / .gitignore
Created March 5, 2016 13:04
new gitignore for android
# built application files
*.apk
*.ap_
# files for the dex VM
*.dex
# Java class files
*.class