Die aktuelle Version findest du unter https://github.com/michamilz/lokalplus
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // dangerously simple PHP regular expression URL router | |
| // requires a mod_rewrite like "RewriteRule . /index.php [L]" | |
| function get($url, $callback) { | |
| $matches = array(); | |
| if (preg_match('~' . $url . '~', $_SERVER['REQUEST_URI'], $matches)) { | |
| echo call_user_func_array($callback, $matches); | |
| die(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
| // | |
| // Converts code indentation from 2 spaces to 4 spaces | |
| // | |
| // For a hotkey, add to Preferences > Key Bindings - User: | |
| // | |
| // { "keys": ["ctrl+alt+i"], "command": "run_macro_file", "args": {"file": "res://Packages/User/ConvertTwoSpacesToFour.sublime-macro"} } | |
| // | |
| [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // To unzip the epub, move the ePub to a folder, cd to it then simply: | |
| unzip MyEbook.epub | |
| // To zip up an epub: | |
| 1. zip -X MyNewEbook.epub mimetype | |
| 2. zip -rg MyNewEbook.epub META-INF -x \*.DS_Store | |
| 3. zip -rg MyNewEbook.epub OEBPS -x \*.DS_Store | |
| Some explanations necessary here. We start each line with two flags: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| public function findByPlaceAndRadius(Place $place, $radius, $limit = 15) { | |
| $latitude = $place->getLatitude(); | |
| $longitude = $place->getLongitude(); | |
| $angleRadius = $radius / 111; | |
| $min_lat = $latitude - $angleRadius; | |
| $max_lat = $latitude + $angleRadius; | |
| $min_lon = $longitude - $angleRadius; | |
| $max_lon = $longitude + $angleRadius; |