"Power is gained by sharing knowledge, not hoarding it."


Dictionary Comprehension

I use list comprehensions all the time in python. They’re great for condensing code so that it can be more readable:

mylist = [ obj.name for obj in objectlist ]

Sometimes I want to generate a key/value pair for each,  


tags:  | 

Editors for Code

As a freelancer and full-stack developer, I find myself multi-tasking across languages. Besides the tough task of remembering which languages use semicolons, finding editors that work across multiple languages (or at least have similar hotkeys) has been challenging. Although most of my development is on Mac, I often need to use editors on different platforms.

I do a re-evaluation once or twice a year (usually when one editor is making me particularly frustrated). These are the two that I now use, pretty much exclusively (plus some short information about other ones I’ve tried).


tags:  |   |   |   | 

Finding python subclasses of a class

For defining commands and routes in Ansible Role Manager, I used the django design pattern for defining custom management commands. Each command is a unique file in a specific directory that subclasses from an abstract base class. To do this requires python-flavored instropection to make sure that subclasses and subclasses of subclasses are all found.


tags:  | 

newer || older