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
| /** | |
| * Convert a human-readable string into a slug | |
| * | |
| * 'Sample input string!' gets converted to 'sample-input-string' | |
| * | |
| * @param {string} string Source string | |
| * @param {integer} maxLength Maximum length of slug (defaults to 100) | |
| * @return {string} Slug | |
| */ | |
| var convertToSlug = function (string, maxLength) { |
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 | |
| /** | |
| * Output a JSON response for an API call | |
| * | |
| * @param array $data Data to return | |
| * @param boolean|string $status Status type | |
| * Available status types: | |
| * - true (outputs 'ok') | |
| * - false (outputs 'error') |
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 | |
| /** | |
| * GoogleGeo | |
| * | |
| * Google maps geolocation, to find coordinates of a location | |
| * @author J. Miller | |
| */ | |
| class GoogleGeo { | |
| // GoogleMaps API Key |
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 | |
| /* | |
| Works for the following inputs and more: | |
| dQw4w9WgXcQ | |
| http://www.youtube.com/?v=dQw4w9WgXcQ | |
| http://www.youtube.com/embed/dQw4w9WgXcQ | |
| http://www.youtube.com/username#p/c/5555550123/0/dQw4w9WgXcQ | |
| http://www.youtube.com/v/dQw4w9WgXcQ | |
| http://www.youtube.com/v/dQw4w9WgXcQ?feature=autoshare&version=3&autohide=1&autoplay=1 | |
| http://www.youtube.com/watch?v=dQw4w9WgXcQ&hd=1&t=26s |
NewerOlder