Skip to content

Instantly share code, notes, and snippets.

@sirex
sirex / Makefile
Created August 14, 2014 06:43
Comparison of lightweigh markup languages.
bin/pip: bin/python requirements.txt
bin/pip install -r requirements.txt
bin/python:
virtualenv .
@sirex
sirex / propernames.py
Last active August 29, 2015 14:11
lmdb proper name parser
#!/usr/bin/env python3
"""
LMDB parser and proper name filter.
This script uses LMDB database [1] to extract all proper names.
[1] http://donelaitis.vdu.lt/~vytas/lmdb/
@sirex
sirex / notes.rst
Last active August 29, 2015 14:12
Balsavimo internetu diskusijos konspektas
@sirex
sirex / unwatch_github_repos.js
Last active August 29, 2015 14:15
Selectively unwatch github repositories.
// In case you are a member of a big organization, you may want to unwatch a lot of repositories, by some filter.
// This code snippet allows to unwatch many repositories at once by specified filter.
// Modify this snippet by your needs and paste it to the JavaScript console in your browser.
// https://github.com/watching
$( "button" ).each( function() {
var text = $.trim( $(this).text() );
var repo = $.trim( $(this).closest("li.js-subscription-row").find("a").text() );
if ( text == "Unwatch" && repo.match(/^zopefoundation/) ) {
@sirex
sirex / .gitignore
Last active August 29, 2015 14:16
Savivaldybių ir mero rinkimų 2015 duomenų analizė
/.ipynb_checkpoints/
/tarybu_nariai_-_main_information.csv
@sirex
sirex / .gitignore
Last active August 29, 2015 14:17
VilniusPy #1: asyncio
/VilniusPy-1-asyncio.slides.html
/reveal.js/
/.ipynb_checkpoints/
def test_get_top_menu_page(self):
def render_wholetree(tree, parent, level=0):
yield '%s<ul>' % (' ' * level)
for child in tree[parent]:
yield '%s<li>%s</li>' % (' ' * (level+1), child)
if child in tree:
yield from render_wholetree(tree, child, level+1)
yield '%s</ul>' % (' ' * level)
def render_tree(pages, parent):
@sirex
sirex / .gitignore
Last active August 29, 2015 14:18
PyConLT 2015: Django tips and tricks
/*.slides.html
/reveal.js/
/.ipynb_checkpoints/
/default.style
/env
/fonts
/*.pdf
/*.rst.build_temp