I started writing this in a IRC channel earlier today, but I figured it might be useful share the question and the answer here, to capture it for others. Yes it is a bit lazyweb, but I can’t be the only one doing this, and I’ll share the answer here:
I’m working on a django project, and I’m interested in making a dockerfile so people who want to contribute, but don’t use pip or pipenv regularly, but have used docker before can contribute.
I use circle CI for CI, and I use their docker files for running tests on the project. Is it common/recommended to use the same for easy dev environments?
I’ve been using Atom as my text editor for longer than any other text editor now, after using Textmate, Sublime Text, and Vim for a couple of years each. In this post, I show a little tip I’ve discovered to help make searching more powerful.
This is nice, and it’s common to search for a pattern like some_function or some class like Page in your existing project.
This example here shows a personal site I used to run, searching for mentions of Page in an django project:
However, lets say you’re working on an app, where you’re sure you don’t want to look in some kinds of files that also end in .py. This might be some migration files, which are written in python, but you know you won’t want to look in them for code that controls how an application works right now. To filter out all the migration files, you can and a second negated pattern, by adding the bang/exclamation mark instead, like so:
Searching across files you normally want to ignore in a project
You can do this the quick and dirty way by opening up Atom’s config file here:
And in the config.cson file that’s presented to you, making sure you have this property set to either true or false:
I only really discovered these this year, and it’s not something I new how to do before, and I figured Atom others might find it useful too.
Hope it helps, and happy searching! If you use Atom, and there are any other gems like this, feel free to add a comment below.
I maintain a huge workflowy file of snippets and tricks and, I suspect some of them will be handy for others to use too. I’m going to sharing them regularly, when I’m not sure what to write, mainly to keep the habit of blogging, until it comes naturally.
Part of my professional life, involves me writing a fair amount of python code. When you write python, you end up creating lots of files ending with .py, but when you run the code, you end up with compiled python files, sending in pyc.
If you don’t want loads of pyc files crufting up your workspace, and you’re workignon the command line, there’s a handy little environment variable you can set in your shell, to banish those ugly files once and for good. Run this command before working (or better yet, make it run whenever you open a terminal window):
See, isn’t that better?
I picked up this gem from the Hitchhiker’s Guide to Python, a free, opinionated book from Kenneth Reitz about good practices with working with Python. Reading it will almost certainly improve your python – I know mine is better as a result of spending some looking over it.