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
Hello world! This is just a sample file that can be accessed via a GET over the public internet. :) |
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
-- Retrieve descendants | |
-- ==================== | |
-- retrieve descendants of #4 | |
SELECT c.* | |
FROM Comments AS c | |
JOIN TreePaths AS t ON c.comment_id = t.descendant | |
WHERE t.ancestor = 4; | |
-- Retrieve ancestors |
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
// `date` must be a Date object, otherwise you may | |
// need to change lines 6 and 10 to account | |
// for a different data type. | |
function(date) { | |
// Create a copy of this date object | |
var target = new Date(date.valueOf()); | |
// ISO week date weeks start on Monday | |
// so correct the day number | |
var dayNumber = (date.getDay() + 6) % 7; |