Skip to content

Instantly share code, notes, and snippets.

list_of_items = [
['Wow, did you hear about this thing that happened over here?!?', 201, 10],
['TIL Something interesting happened at some place.', 14, 24],
['My cat.', 101, 14],
['Somebody said this to me the other day. I dont agree with that person.', 449, 55],
['For my cakeday, I want a lot of upvotes and presents.', 348, 33],
['My cat. Part 2.', 777, 13]
]
ranked_list_of_items = sorted(list_of_items, key=lambda x:x[1], reverse=True)
@rodricios
rodricios / googlebyear.py
Created January 3, 2015 06:09
Googling by year(s)
#!/usr/bin/env python
"""googlextract.py
It's Google Search! But stripped from
all its user-friendliness!
This was written as a submodule for a larger endeavor.
Read about it here:
https://github.com/rodricios/crawl-to-the-future/tree/master/crawlers/Crawling-Google
@rodricios
rodricios / summarize.py
Last active November 18, 2020 17:21
Flipboard's summarization algorithm, sort of
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
pip install networkx distance pattern
In Flipboard's article[1], they kindly divulge their interpretation
of the summarization technique called LexRank[2].