This file contains hidden or 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 force = d3.layout.force() | |
.gravity(0.2) | |
.charge(-150) | |
.linkDistance(300) | |
.size([800, 600]); | |
var svg = d3.select("body").append("svg:svg") | |
.attr("id","graph") | |
.attr("width", 800) | |
.attr("height", 600); |
This file contains hidden or 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
#!/bin/bash | |
# Pre-commit hook to make a mysql dump right before committing and add it to the commit. | |
# | |
## Change the following values to suit your local setup. | |
# The name of a database user with read access to the database. | |
DBUSER=root | |
# The password associated with the above user. Leave commented if none. | |
#DBPASS=seekrit | |
# The database associated with this repository. | |
DBNAME=dplay |
This file contains hidden or 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
#!/bin/bash | |
# Pre-commit hook to make a mysql dump right before committing and add it to the commit. | |
# | |
## Change the following values to suit your local setup. | |
# The name of a database user with read access to the database. | |
#Uncomment if mysqldump is not in your path | |
#MYSQLPATH=c:/wamp/bin/mysql/mysql5.5.24/bin | |
#Comment if mysqldump is in your path |
This file contains hidden or 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
// https://gist.github.com/andrei-m/982927#gistcomment-1931258 looks like the fastest Levenshtein implementation | |
const levenshtein = (a, b) => { | |
if (a.length === 0) return b.length | |
if (b.length === 0) return a.length | |
let tmp, i, j, prev, val | |
// swap to save some memory O(min(a,b)) instead of O(a) | |
if (a.length > b.length) { | |
tmp = a | |
a = b | |
b = tmp |