Skip to content

Instantly share code, notes, and snippets.

View thedjinn's full-sized avatar

Emil Loer thedjinn

  • Hi Auto
  • Leeuwarden, Netherlands
View GitHub Profile
require("./walk").walk(
"/path/to/a/directory",
function(file) {
console.log(file);
},
function(err) {
if(err) throw err;
console.log("Finished.");
}
);
# 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