Skip to content

Instantly share code, notes, and snippets.

@JDMcKinstry
JDMcKinstry / levenshtein.js
Last active May 7, 2016 15:13 — forked from andrei-m/levenshtein.js
Levenshtein distance between two given strings implemented in JavaScript and usable as a Node.js module
/* String.similarTo("compare", [BOOL (default TRUE) if do reverse check])
* Credit to for base formula Andrei Mackenzie
* https://gist.github.com/andrei-m/982927
**/
;(function() {
function l(a, b) {
if(a.length == 0) return b.length;
if(b.length == 0) return a.length;
var matrix = [];
for(var i=0;i<=b.length;i++) matrix[i] = [i];
@JDMcKinstry
JDMcKinstry / main.css
Last active December 18, 2015 07:29 — forked from bmegod/gist:5731771
/* ==========================================================================
Globals
========================================================================== */
@font-face {
font-family: 'GaramondPro';
src: url('fonts/AGaramondPro-Regular.otf');
font-weight: normal;
font-style: normal;
}
@JDMcKinstry
JDMcKinstry / index.html
Last active December 18, 2015 07:29 — forked from bmegod/gist:5731763
<!DOCTYPE html>
<html class="no-js">
<head>
<!-- Include meta data first, although this is slowly becoming less read by modern browsers -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta http-equiv="cache-control" content="no-cache" />
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
@JDMcKinstry
JDMcKinstry / main.js
Last active December 18, 2015 07:29 — forked from bmegod/gist:5731746
;(function($) {
if (!$.aniAutoHeight) {
$.extend({
aniAutoHeight: function(elm, speed) {
if (!speed) speed = 200;
return elm.each(function(index){
var curHeight = $(this).height(),
autoHeight = $(this).css('height', 'auto').height();
$(this).height(curHeight).animate({height: autoHeight}, speed, function() { $(this).height('auto'); });
});
@JDMcKinstry
JDMcKinstry / main.css
Last active December 18, 2015 07:19 — forked from bmegod/gist:5731771
/* ==========================================================================
Globals
========================================================================== */
@font-face {
font-family: 'GaramondPro';
src: url('fonts/AGaramondPro-Regular.otf');
font-weight: normal;
font-style: normal;
}
;(function($) {
if (!$.aniAutoHeight) {
$.extend({
aniAutoHeight: function(elm, speed) {
if (!speed) speed = 200;
return elm.each(function(index){
var curHeight = $(this).height(),
autoHeight = $(this).css('height', 'auto').height();
$(this).height(curHeight).animate({height: autoHeight}, speed, function() { $(this).height('auto'); });
});