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 | |
| function distance($latitudeFrom, $longitudeFrom, $latitudeTo, $longitudeTo) { | |
| $rad = M_PI / 180; | |
| $theta = $longitudeFrom - $longitudeTo; | |
| $dist = sin($latitudeFrom * $rad) * sin($latitudeTo * $rad) + cos($latitudeFrom * $rad) * cos($latitudeTo * $rad) * cos($theta * $rad); | |
| return acos($dist) / $rad * 60 * 1.852; | |
| } |
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
| function distance(lat1, lon1, lat2, lon2) { | |
| var p = 0.017453292519943295; // Math.PI / 180 | |
| var c = Math.cos; | |
| var a = 0.5 - c((lat2 - lat1) * p)/2 + | |
| c(lat1 * p) * c(lat2 * p) * | |
| (1 - c((lon2 - lon1) * p))/2; | |
| return 12742 * Math.asin(Math.sqrt(a)); // 2 * R; R = 6371 km | |
| } |
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
| <pre> | |
| <?php | |
| $path = realpath(__DIR__); | |
| echo "<p>Zipping...</p>"; | |
| $zip = new ZipArchive(); | |
| $zip->open(dirname(__FILE__).'.zip', ZipArchive::CREATE | ZipArchive::OVERWRITE); | |
| $files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path)); | |
| foreach ($files as $name => $file) { | |
| if ($file->isDir()) { | |
| echo $name . "\r\n"; |
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
| <div class="interactive"> | |
| <div class="toggle"> | |
| <p class="waves-effect">CLICK ME</p> | |
| </div> | |
| <div class="hideable"> | |
| <p>I wrap the content. Lorem what?</p> | |
| </div> | |
| </div> | |
| <style type="text/css"> |
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
| find . -type f -exec sed -i 's/search/replace/g' {} + |
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 | |
| if (!defined('ABSPATH')) exit; | |
| function checkbox($data=array()) { | |
| $instance = '_'.uniqid(); | |
| $text = $data['text'] ?? ''; | |
| $checked = $data['checked'] ?? ''; | |
| $name = $data['name'] ?? ''; | |
| $class = $data['class'] ?? ''; | |
| ob_start('ob_gzhandler'); | |
| ?> |
OlderNewer