Skip to content

Instantly share code, notes, and snippets.

View hakunin's full-sized avatar

Michal Hantl hakunin

  • Ostrava, Czech Republic
  • 21:30 (UTC -12:00)
View GitHub Profile
# adapted from https://gist.github.com/johdax/771943
# modified to work without creating new String methods
class StringDistance
def self.damerau_levenshtein(str1, str2)
d = Array.new(str1.size+1){Array.new(str2.size+1)}
for i in (0..str1.size)
d[i][0] = i
end
for j in (0..str2.size)
class window.ServicesView extends CommonView
SLOGAN_PLACEHOLDER: 'Enter a Slogan here. Sell your skills in a sentence.'
template: =>
"""
<div el="slogan_wrap">
<span el="counter"></span>
<textarea el="slogan"