Skip to content

Instantly share code, notes, and snippets.

View geier's full-sized avatar
🐜
Slow but steady

Christian Geier geier

🐜
Slow but steady
View GitHub Profile
" Python specific settings.
setlocal tabstop=4
setlocal shiftwidth=4
setlocal expandtab
setlocal cindent
setlocal smarttab
setlocal formatoptions=croql
setlocal number
" Start python on F5
map <F5> :w<CR>:!python "%"<CR>
import platform
import requests
import sys
print platform.platform()
print 'python:', sys.version
print 'requests:', requests.__version__
@geier
geier / keybase.md
Created September 22, 2014 20:25
keybase

Keybase proof

I hereby claim:

  • I am geier on github.
  • I am geier (https://keybase.io/geier) on keybase.
  • I have a public key whose fingerprint is 2BC4 36ED 4FF4 61B9 8A1E F167 63D4 D665 561F FEEC

To claim this, I am signing this object:

@geier
geier / calendar_widget_test.py
Last active June 7, 2023 19:44
minimial test for CalendarWidget for urwid
from datetime import date as date
import urwid
from calendarwidget import CalendarWidget
PALETTE = [
('header', 'white', 'black'),
('footer', 'white', 'black'),
('line header', 'black', 'white', 'bold'),
('bright', 'dark blue', 'white', ('bold', 'standout')),
@geier
geier / urwid_example.py
Created May 3, 2016 15:41
minimal urwid example (ListWalker)
import urwid
class SelectableText(urwid.Text):
def selectable(self):
return True
def keypress(self, size, key):
return key
content = urwid.SimpleListWalker([
@geier
geier / generate_example_events.py
Created June 14, 2016 23:19
example of creating new events with khal (hardcoded config file named test.conf)
import khal
from khal.settings import get_config
from khal.cli import build_collection
from khal.controllers import new_from_string
from datetime import date, timedelta
today = date.today()
config = get_config('test.conf')
@geier
geier / test.conf
Created June 14, 2016 23:20
example khal config
[calendars]
[[home]]
path = ~/.local/share/khal/calendars_test/home/
color = dark green
[[work]]
path = ~/.local/share/khal/calendars_test/work/
color = dark blue
[[events]]
Verifying that "cgeier.id" is my Blockstack ID. https://onename.com/cgeier
#!/usr/bin/python
# Copyright (C) 2013 Patrick Totzke <[email protected]>
# This file is released under the GNU GPL, version 3 or a later revision.
#
# adapted from example1.py and example3.collapse.py from the urwidtrees examples
from urwidtrees.tree import SimpleTree
from urwidtrees.decoration import CollapseIconMixin, DecoratedTree
from urwidtrees.widgets import TreeBox
import urwid