![blobs.png](https://gist.github.com/thedjinn/894940/raw/8b0d853b69e89a4f626906a67812599cb9e20bf0/blobs.png)
This file contains 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
# We have four scores, two of them share the second place. This means the last | |
# one has to be pushed to the fourth place. | |
scores = [10, 9, 9, 8] | |
ranking, last_score, add = 0, 0, 1 | |
rankings = scores.map do |score| | |
scores.index(score) + 1 | |
end |
This file contains 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
require("./walk").walk( | |
"/path/to/a/directory", | |
function(file) { | |
console.log(file); | |
}, | |
function(err) { | |
if(err) throw err; | |
console.log("Finished."); | |
} | |
); |