Blogs

Google calendar - download all entries with Python

Google provides APIs to access its data using various languages. You can manipulate Google calendars, contacts, documents etc. Most of the time the usage is pretty straightforward, but sometimes it is not clear how to achieve a specific goal. For example, it took me some time to figure out how to download all events for a given calendar. The main reason behind the difficulty is the upper limit Google places on the number of calendar entries returned by a single query. There are API calls, which help you to overcome this constraint. Below is the relevant code for your enjoyment.

Generating text (ASCII) tables with python

Sometimes you might need to generate tables in good old plain text. Doing so by hand might be very tedious and error prone. Better let the computer to do the job! Luckily, off the self components exist to do just that. Specifically, Python can be used to perform this task. Here's a link to the relevant python recipe. Alternatively, there is a ready made module TextTable, which is also quite convenient.

Synchronizing Google contatcts' birthdays with Android

Google Contacts allow setting birthdays, which are then picked up by Google Calendar automatically and displayed as events on the relevant day. This is very convenient for keeping track of your relatives', friends' and other people's birthdays. Having a reminder saves you an embarrassment of forgetting your girlfriend's/boyfriend's/auntie's day of birth and prevents unnecessary bad feelings.

Tradegy in Oslo

We are all devastated by the terrible events in Oslo, Norway, where almost 100 people were killed in two closely linked incidents of terrorism. Browsing the news about these events, I couldn't help but notice facial similarity between the alleged executor of the terrible acts, a certain Anders Behring Breivik, and the notoriously famous manager of Wikileaks, Julian Assange.

Topic: 

Vim line wrapping and word boundary

Vim (vi) is a very powerful and customizable text editor. There are many parameters you can fine-tune to adjust the way your data is displayed. For example, vim can visually wrap lines, which are too long to fit the width of the screen. This is "virtual" wrapping - no new line characters are actually added to the text. By default, vim wraps the text at the last character, which fits in the visible area. However, especially when editing long runs of text, it is much more convenient to see lines wrap at word boundaries. To achieve this simply use the following command:

Event Importer for Google calendar

I have released a new product: Event Importer for Google calendar. It allows importing iCalendar files (.ics), downloaded via browser quickly and easily. Possible use cases: event export from Facebook, Meetup, other online services, e-mailed .ics files etc. Please give it a try and let me know what you think.

Editing Markdown or txt files in OpenOffice

I have been introduced to Markdown format some time ago and today I find it extremely convenient for most of the writing I need to do. Markdown is essentially "markup without markup" - it requires you to do very little in order to format your text and it can be easily converted in a number of other formats, such as PDF, Word, ODT, LaTeX, HTML, Docbook etc. From experience I found that the most convenient environment to edit Markdown files is OpenOffice (or LibreOffice). Not only is it free and open source, it is actually quite convenient.

Right-align help menu in a WPF application

If you want to right-align the "Help" (or any other) menu entry in your menu bar in a WPF application, you can use the following example:

  1. <Menu>
  2.     <Menu.ItemsPanel>
  3.         <ItemsPanelTemplate>
  4.             <DockPanel HorizontalAlignment="Stretch"/>
  5.         </ItemsPanelTemplate>
  6.     </Menu.ItemsPanel>
  7.     <MenuItem Header="File">
  8.         <MenuItem Header="Exit"/>
Topic: