Skip to content

Instantly share code, notes, and snippets.

View epogrebnyak's full-sized avatar

Evgeny Pogrebnyak epogrebnyak

View GitHub Profile
@ajmendez
ajmendez / age.py
Last active October 16, 2022 18:45
Here is a nice little wikipedia parser for grabbing an date of birth and date of death for a individual with an infobox template. This template is found generally on famous people. Works with people who are still alive by returning None for death_date.
import urllib2, json, pprint, re, datetime
import mwparserfromhell
def _parseDate(wikiDate):
''' Parse a mediawiki date template -- assumes years, month, day
Input:
a mwparser object containing just the date to be parsed
Returns:
datetime.date object of the date
'''
@uiur
uiur / parse.hs
Created November 22, 2011 19:52
Haskellの練習: Monadic parser combinator using Maybe
-- プログラミングHaskellのパーサコンビネータの実装をMaybeモナドを使うようにしてみた
-- Programming in Haskell : 8 Chapter
module Parsing where
import Char
import Monad
infixr 5 +++
newtype Parser a = Parser {getParser :: String -> Maybe (a,String)}
@brantfaircloth
brantfaircloth / sphinx_to_github.sh
Created January 23, 2011 02:40
Sphinx documentation to github gh-pages without submodules
# assume the following directory structure where contents of doc/
# and source/ are already checked into repo., with the exception
# of the _build directory (i,e. you can check in _themes or _sources
# or whatever else).
#
# proj/
# source/
# doc/
# remove doc/_build/html if present