Move post code chunks to Gists

Also, remove highlight specific things from style.sass
This commit is contained in:
Gergely Polonkai
2015-04-27 11:00:04 +02:00
parent 32fac1feae
commit 2f61b11a5a
11 changed files with 20 additions and 665 deletions

View File

@@ -14,13 +14,4 @@ Just insert it in your database, feed them two Google coordinates, and you get
the distance in kilometres. If you happen to need it in miles, change the
constant `12756.200` in the `RETURN` row to `7922.6` instead.
{% highlight sql %}
DELIMITER $$
CREATE FUNCTION `haversine` (lng1 FLOAT, lat1 FLOAT, lng2 FLOAT, lat2 FLOAT)
RETURNS float NO SQL DETERMINISTIC
BEGIN
SET @a = ABS(POWER(SIN(RADIANS(lat1 - lat2)) / 2, 2) + COS(RADIANS(lat1)) * COS(RADIANS(lat2)) * POWER(SIN(RADIANS(lng1 - lng2)) / 2, 2));
RETURN 12756.200 * ATAN2(SQRT(@a), SQRT(1 - @a));
END$$
{% endhighlight %}
{% gist gergelypolonkai/bdad1cf2d410853bef35 %}