Skip to content

Instantly share code, notes, and snippets.

View atufkas's full-sized avatar
🎸
Rock 'n' Roll

Matthias Lienau atufkas

🎸
Rock 'n' Roll
View GitHub Profile
@atufkas
atufkas / migrate_mysq4to5.sh
Last active June 18, 2019 13:47
Converting MySQL4 database dump syntax to MySQL5
#
# MIGRATE MySQL4 DATABASES TO MySQL5 - Steps for dumping and converting
#
# Uses mysqldump and patches output to be compatible with MySQL 5.5+ (? - no sure
# at which specific release of MySQL 5 the old style syntax support ended).
#
# Conversion is most likely incomplete. It does some essential converting where
# I regularly experienced problems during migration.
#
# Use on own risk, always try with test databases first. No warranty at all!
@atufkas
atufkas / README.md
Last active August 26, 2021 22:43
rss feed generation from mongojs result using node, express and node-rss

Situation

For my tiny blog (engine) based on node, express/connect and mongojs I needed a simple rss feed solution. I discovered and decided to go with the nice working npm module node-rss instead of writing xml myself.

What this code example does

Basically I create an get event on route /feed/rss, generate a node-rss object initialized with base values and add item elements to it while looping over a mongojs collection result array (holding my post items to be reflected). Finally I send a response with an appropriate content type header. My example is directly bound to an express get event callback for a simple static request path, but you may of course move it to route exports or whatever.

Notes

No big deal, but you might find this portion of code useful as a starting point when seeking for rss solutions.