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
BEGIN | |
DECLARE id INT DEFAULT NULL; | |
DECLARE pid INT DEFAULT NULL; | |
DECLARE idx INT DEFAULT NULL; | |
CREATE TEMPORARY TABLE `temp_table` ( | |
`ord` int NOT NULL AUTO_INCREMENT, | |
`id` int NOT NULL, | |
`pid` int, | |
`idx` int NOT NULL, |
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 `slugify`;; | |
CREATE FUNCTION `slugify`(`original` varchar(512) CHARACTER SET 'utf8mb4') RETURNS varchar(512) CHARSET ascii | |
BEGIN | |
DECLARE translit VARCHAR(512) DEFAULT ''; | |
DECLARE len INT(3) DEFAULT 0; | |
DECLARE pos INT(3) DEFAULT 1; | |
DECLARE letter CHAR(6); |
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
{ | |
"name": "myLib", | |
"version": "0.1.0", | |
"private": true, | |
"scripts": { | |
"serve": "vue-cli-service serve", | |
"build": "vue-cli-service build --target lib --name ${npm_package_name} ./src/main.js" | |
}, | |
"devDependencies": { | |
"@vue/cli-plugin-babel": "~4.5.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
/** | |
* EVENT_NAME_MAP is used to determine which event fired when a | |
* transition/animation ends, based on the style property used to | |
* define that event. | |
*/ | |
var EVENT_NAME_MAP = { | |
transitionend: { | |
'transition': 'transitionend', | |
'WebkitTransition': 'webkitTransitionEnd', | |
'MozTransition': 'mozTransitionEnd', |
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 | |
/** | |
* PHP class to convert Latitude & Longitude coordinates into UTM & Lambert Conic Conformal Northing/Easting coordinates. | |
* | |
* This class encapsulates the methods for representing a geographic point on the earth in three different coordinate systema. Lat/Long, UTM and Lambert Conic Conformal. | |
* | |
* Code for datum and UTM conversion was converted from C++ code written by Chuck Gantz (chuck.gantz@globalstar.com) from http://www.gpsy.com/gpsinfo/geotoutm/ | |
* This code was converted into PHP by Brenor Brophy (brenor@sbcglobal.net) and later refactored for PHP 5.3 by Hans Duedal (hd@onlinecity.dk). | |
* |
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 parse_object(obj){ | |
var stack =[[Object.keys(obj), obj]], | |
t = stack[0], | |
o, | |
k = t[0].shift(); | |
while(true){ | |
while(k){ |
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
/**** save an array of integer to an hexa string and back ***/// | |
function num2b(num, len){ | |
var arr = [], | |
top = 32-len, | |
mask=(2<<(len-1))-1,//len:1 is binary | |
v = num>>>top, | |
lead=false; | |
if(v!==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
var Complex = function(real, imag) { | |
if (!(this instanceof Complex)) { | |
return new Complex (real, imag); | |
} | |
if (typeof real === "string" && imag == null) { | |
return Complex.parse (real); | |
} | |
this.real = Number(real) || 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 levenshtein(a, b) | |
if a:len() == 0 then return b:len() end | |
if b:len() == 0 then return a:len() end | |
local matrix = {} | |
local a_len = a:len()+1 | |
local b_len = b:len()+1 | |
-- increment along the first column of each row | |
for i = 1, b_len do |
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
-- LUA HTML parser | |
local empty_tags = { | |
br = true, | |
hr = true, | |
img = true, | |
embed = true, | |
param = true, | |
area = true, |
NewerOlder