emacs tip of the week #3: ido-switch-buffer

Hopefully you are already using ido or something similar to enhance emacs tab completion. I only use ido-switch-buffer ((ido-mode ‘buffer) in .emacs) as I dislike ido-find-file. What I don’t like is accidentally typing \C-x\C-b for buffer-menu-other-window (or whatever it is) when I meant \C-x b. So I put this in .emacs: (global-set-key “\C-x\C-b” ‘ido-switch-buffer)  

simple is better

Keeping things simple (and independent) is very important in my opinion. But since it is often faster (at the beginning), and especially needs much less thinking and experience to make things unnecessarily complex, that’s unfortunately what most people do… So, the purpose of this site is to show some “simple alternatives”—or at least some “things”, …

Continue reading ‘simple is better’ »

emacs tip of the week #2: elpy

I used to have a very complex .emacs config for python development, then I discovered elpy. It bundles together various python lisp modules cohesively, supports virtual environments, loading “project” files (via elpy-find-file), refactoring, running tests and so on. I’m not even tempted to use PyCharm much any more.  

Simple example of using the threading Timer class in python

[cc lang=”python”] #!/usr/bin/env python # simple example of threading.Timer in python import time, threading class Counter(object): def __init__(self, initial = 0, update_interval = 5): self.counter = initial self.update_interval = update_interval def inc(self): self.counter += 1 # Timer only runs once so call recursively in inc() threading.Timer(self.update_interval, self.inc).start() a = Counter() b = Counter(50, 10) c …

Continue reading ‘Simple example of using the threading Timer class in python’ »