Skip to content

Instantly share code, notes, and snippets.

View BharathMG's full-sized avatar
🎯
Focusing

mgb BharathMG

🎯
Focusing
View GitHub Profile
func EncodePolyline(coordinates []*Point) string {
if len(coordinates) == 0 {
return ""
}
factor := math.Pow(10, 5)
output := encode(coordinates[0].Lat, factor) + encode(coordinates[0].Lng, factor)
for i := 1; i < len(coordinates); i++ {
a := coordinates[i]
@BharathMG
BharathMG / refresh-ever.go
Last active August 29, 2015 14:14
Stop manually refreshing Movie booking sites to check if they started selling your favourite movie tickets. This prog will run forever until they open the booking.
package main
import (
"fmt"
"io/ioutil"
"net/http"
"os"
"strings"
"github.com/skratchdot/open-golang/open"
)
#!/bin/bash
function f() {
sleep "$1"
echo "$1"
}
while [ -n "$1" ]
do
f "$1" &
shift
done
@BharathMG
BharathMG / ReadME
Created April 30, 2012 20:27
First Push
This Validator focuses on validating
1.Name Field
2.Phone Number Field