Skip to content

Instantly share code, notes, and snippets.

View toranb's full-sized avatar

Toran Billups toranb

View GitHub Profile
@andrei-m
andrei-m / levenshtein.js
Last active January 12, 2024 23:00
Levenshtein distance between two given strings implemented in JavaScript and usable as a Node.js module
/*
Copyright (c) 2011 Andrei Mackenzie
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
@jerel
jerel / EmberJS-resources.md
Last active December 20, 2015 13:19
A compilation of links about EmberJS that may help you decide why you should or should not use it for your projects.
I put this together while exploring EmberJS for myself to see if it was a good fit. If anybody reads this and would like to add links to it please do. Just make sure it's a resource that is up-to-date and point out what about it you liked. Newest ones are added to the top.

July 2013

June 2013

@kidbombay
kidbombay / Live View Hooks Example
Created August 24, 2021 20:39
Getting Live View to work with Javascript Hooks
### In App.js initialize the hook and set it on the LiveSocket
### Tested with LiveView 0.15.7
```
Hooks.MyHook = {
mounted() {
console.log("MyHook.mounted")
},
updated() {
console.log("MyHook.updated")
}