Skip to content

Instantly share code, notes, and snippets.

View ondrae's full-sized avatar

Andrew Hyder ondrae

View GitHub Profile
@ksamuel
ksamuel / feeds.py
Created October 24, 2011 00:39
RSS/Atom link auto detection. Use feedparser and beautifulsoup
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: ai ts=4 sts=4 et sw=4
"""
Tools to extract feed links, test if they are valid and parse them
with feedparser, returning content or a proper error.
"""
@kkestell
kkestell / gist:7224409
Last active October 4, 2016 03:45
Using Upstart to Keep Puma Running

Add an Upstart script to start Puma and keep it running:

# nano /etc/init/puma.conf

Add:

start on startup
stop on shutdown

env RAILS_ENV=staging

A few more years of the same, though, and I got used to it: I would load entire libraries from country castles and city mansions, fine, rare, leather- and Morroco-bound books, load whole trains full, and as soon as a train had thirty cars, off it would go to Switzerland or Austria, one kilogram of rare books for the equivalent of one crown of convertible currency, and nobody blinked an eye, nobody shed a tear, not even I myself, no, all I did was stand there smiling as I watched the train hauling those priceless libraries off to Switzerland and Austria for one crown in convertible currency a kilo. By then I had mustered the strength to look upon misfortune with composure, to still my emotions, by then I had begun to understand the beauty of destruction and I loaded more and more freight cars, and more and more trains left the station heading west at one crown per kilogram, and as I stood there staring after the red lantern hanging from the last car, as I stood there leaning on a lamppost like Leonardo da Vinc