Skip to content

Instantly share code, notes, and snippets.

View umutakturk's full-sized avatar
🏠
Working from home

Umut Akturk umutakturk

🏠
Working from home
View GitHub Profile
@umutakturk
umutakturk / distance.php
Created June 27, 2013 21:21
Calculating distance between two geo-points.
<?php
function distance($fromLat, $fromLon, $toLat, $toLon) {
$radius = 6378.1; // 3963.17 miles
$dLat = deg2rad($toLat - $fromLat);
$dLon = deg2rad($toLon - $fromLon);
$tmp = cos(deg2rad(($fromLat + $toLat) / 2)) * $dLon;
$distance = $radius * sqrt($dLat * $dLat + $tmp * $tmp);
return round($distance, 1);
}
@umutakturk
umutakturk / heroku_timezone.sh
Created July 21, 2013 23:09
Change heroku timezone from the CLI.
heroku config:add TZ=Europe/Istanbul
@umutakturk
umutakturk / file.md
Created January 7, 2014 10:48
PHP kodun renklendirilmiş çıktısı.
$ php -s input.php > output.html
@umutakturk
umutakturk / A-HopperBus-CodeSample-Readme.md
Created May 29, 2018 20:11 — forked from TosinAF/A-HopperBus-CodeSample-Readme.md
Example use of the Model-View-ViewModel Pattern in iOS (Swift) as explained in http://www.objc.io/issue-13/mvvm.html. Full Source Code can be found at https://github.com/TosinAF/HopperBus-iOS

I decided to build an iOS app for my University's bus service that runs through the various campuses.

xy

It was an interesting challenge as I had nothing but the printed timetables (http://www.nottingham.ac.uk/about/documents/903-times.pdf) to use as the data.

Thus I had to come with a suitable data structure that would complement the design & user experience i had in mind for the app.

I also decided to take the challenge of writing the app in swift. This project has helped me get to up speed with swift really quickly.