<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>
-
URL
<The URL Structure (path only, no root url)>
-
Method:
| <?php | |
| function is_valid_luhn($number) { | |
| settype($number, 'string'); | |
| $sumTable = array( | |
| array(0,1,2,3,4,5,6,7,8,9), | |
| array(0,2,4,6,8,1,3,5,7,9)); | |
| $sum = 0; | |
| $flip = 0; | |
| for ($i = strlen($number) - 1; $i >= 0; $i--) { | |
| $sum += $sumTable[$flip++ & 0x1][$number[$i]]; |
| /** | |
| * Luhn algorithm in JavaScript: validate credit card number supplied as string of numbers | |
| * @author ShirtlessKirk. Copyright (c) 2012. | |
| * @license WTFPL (http://www.wtfpl.net/txt/copying) | |
| */ | |
| var luhnChk = (function (arr) { | |
| return function (ccNum) { | |
| var | |
| len = ccNum.length, | |
| bit = 1, |
| /** | |
| * Generates the string for the Haversine function. We assume that the `zipcode`, `latitude`, | |
| * and `longitude` columns are named accordingly. We are also not doing much error-checking | |
| * here; this is a simple text cruncher to make things prettier. | |
| * We may also be integrating some extra SQL in, passed in via the $extra parameter | |
| * | |
| * @param string $table The table to search in | |
| * @param float $lat The latitude part of the reference coordinates | |
| * @param float $lng The longitude part of the reference coordinates | |
| * @param int $radius The radius to search within |
| var numTiers = 100, | |
| triangle, | |
| start, | |
| stop; | |
| /** | |
| * | |
| * First version uses recursion | |
| * | |
| */ |
| Event::listen('404', function() | |
| { | |
| $username = URI::segment(1); | |
| $user = User::where_username($username) | |
| ->where_type('account') | |
| ->first(); | |
| if ($user != null) { | |
| if ($user->username != '') { |
| $ cd ~ | |
| $ sudo curl -sS https://getcomposer.org/installer | sudo php | |
| $ sudo mv composer.phar /usr/local/bin/composer | |
| $ sudo ln -s /usr/local/bin/composer /usr/bin/composer | |
| then you can run | |
| $ sudo composer install |
Press minus + shift + s and return to chop/fold long lines!
Other people's projects:
My projects (tutorials are on my blog at http://maxoffsky.com):