Skip to content

Instantly share code, notes, and snippets.

View lintangtimur's full-sized avatar
🔐
afaf9e15a4058b9c2fd7de85

MJ lintangtimur

🔐
afaf9e15a4058b9c2fd7de85
  • Semarang, Indonesia
  • 10:49 (UTC +07:00)
View GitHub Profile
@Fil
Fil / point_in_polygon.php
Created August 28, 2013 06:28
point in polygon
<?php
/* is (lon, lat) inside the polygon $p?
* use ray casting algorithm (http://en.wikipedia.org/wiki/Point_in_polygon)
* ie. project a horizontal line from our point to each segment
* code adapted from http://stackoverflow.com/questions/14149099/raycasting-algorithm-with-gps-coordinates
*/
function inside_polygon($test_point, $points) {
@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream