This file contains 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
if (typeof define !== 'function') { var define = require('amdefine')(module); } | |
define(function() { | |
return { | |
indexOf : function(arr, item) { | |
return arr.indexOf(item) | |
}, | |
sum : function(arr) { | |
var total = 0; |
This file contains 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 isPalindrome(word) { | |
var letters = word.split(''); | |
var length = letters.length; | |
for (i in letters) { | |
if (letters[i] != letters[(length-1)-i]) return false; | |
} | |
return true; | |
} |
This file contains 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
DROP FUNCTION IF EXISTS `ISBN13to10`; | |
delimiter // | |
CREATE FUNCTION `ISBN13to10`(isbn13 VARCHAR(50)) RETURNS varchar(50) CHARSET utf8 | |
BEGIN | |
DECLARE isbn10 VARCHAR(13); | |
DECLARE i VARCHAR(13); | |
DECLARE sum INT; | |
DECLARE chk INT; | |
DECLARE chkchar VARCHAR(3); |
This file contains 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
DROP FUNCTION IF EXISTS `ISBN10to13`; | |
delimiter // | |
CREATE FUNCTION `ISBN10to13`(isbn10 VARCHAR(50)) RETURNS varchar(50) CHARSET utf8 | |
BEGIN | |
DECLARE isbn13 VARCHAR(13); | |
DECLARE i INT; | |
DECLARE chk INT; | |
IF (LENGTH(ISBN10) > 10) THEN | |
RETURN ISBN10; |
This file contains 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 | |
/** | |
* Query builder scope to list neighboring locations | |
* within a given distance from a given location | |
* | |
* @param Illuminate\Database\Query\Builder $query Query builder instance | |
* @param mixed $lat Lattitude of given location | |
* @param mixed $lng Longitude of given location | |
* @param integer $radius Optional distance |
This file contains 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
a | |
ii | |
about | |
above | |
according | |
across | |
39 | |
actually | |
ad | |
adj |
This file contains 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
DELIMITER ; | |
DROP FUNCTION IF EXISTS urlencode; | |
DELIMITER | | |
CREATE FUNCTION urlencode (s VARCHAR(4096)) RETURNS VARCHAR(4096) | |
DETERMINISTIC | |
CONTAINS SQL | |
BEGIN | |
DECLARE c VARCHAR(4096) DEFAULT ''; | |
DECLARE pointer INT DEFAULT 1; | |
DECLARE s2 VARCHAR(4096) DEFAULT ''; |
This file contains 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
DELIMITER ; | |
DROP FUNCTION IF EXISTS urldecode; | |
DELIMITER | | |
CREATE FUNCTION urldecode (s VARCHAR(4096)) RETURNS VARCHAR(4096) | |
DETERMINISTIC | |
CONTAINS SQL | |
BEGIN | |
DECLARE c VARCHAR(4096) DEFAULT ''; | |
DECLARE pointer INT DEFAULT 1; | |
DECLARE h CHAR(2); |
OlderNewer