Skip to content

Instantly share code, notes, and snippets.

View jhartman86's full-sized avatar

Jono Hartman jhartman86

  • The Zero Card
  • Denver
View GitHub Profile
@phpenterprise
phpenterprise / string-similarity-mysql.sql
Created June 25, 2019 15:21
String Similarity with MySQL
DELIMITER $$
CREATE DEFINER=`root`@`localhost` FUNCTION `COMPARE_STRING`( s1 text, s2 text) RETURNS int(11)
DETERMINISTIC
BEGIN
DECLARE s1_len, s2_len, i, j, c, c_temp, cost INT;
DECLARE s1_char CHAR;
DECLARE cv0, cv1 text;
SET s1_len = CHAR_LENGTH(s1), s2_len = CHAR_LENGTH(s2), cv1 = 0x00, j = 1, i = 1, c = 0;
IF s1 = s2 THEN
RETURN 0;
# Cookbook Name:: mongodb
# Recipe:: default
case node['platform']
when "ubuntu"
execute "apt-get update" do
action :nothing
end
execute "add gpg key" do