1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | |
[Python] Patching platform.uname in Tests
Posted on in Programming
Posted on in Programming
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | |
Posted on in Programming
There are lots of reasons why your Git repository remotes might move. I recently dealt with a migration to GitHub. You can always just clone the repository again and go about your business, but I had several local branches I wanted to keep working on.
There's lots of ways to …
Posted on in Programming
For work, I need a personal GitHub account in addition to my Enterprise Managed User (EMU) account. After updating my SSH keys the other day, I realized I had inadvertently locked myself out of using my personal account on my work laptop.
Here's what that looked like:
$ git pull
ERROR …Posted on in Programming
Posted on in programming
I thought it would be neat to keep an eye on the popular google search terms related to Python.
The list below uses JavaScript from Google Trends. You can use the kebab menu icon to choose between "Top" and "Rising" search phrases.
Posted on in programming
I had this interesting question the other day. Someone had a file with two columns of data in it. They wanted to assign each column to a different variable and then take action using those two variables. Here's the example I wrote for them:
IFS=$'\n';
for LINE in $(cat …Posted on in Programming
I was recently asked to take two lists and interleave them. Although I can not
think of a scenario off the top of my head where this might be useful, it doesn't
strike me as a completely silly thing to do.
StackOverflow's top answer
for this problem uses itertools.chain …
Posted on in Programming
Things have changed quite a lot since this post was originally written in 2016. Currently, I would recommend switching over to making asynchronous calls via aiohttp.
One of my scripts that makes an API call has been failing silently lately. It appears that the connection is timing out, but I …
Posted on in Programming
I've got some code that generates loss reports for EVE Online. It uses the
EVE-KILL API and
Python's urllib2 library. Near
the end of October 2015, I noticed that my calls to the API were returning a
403: Forbidden error from the server. I didn't realize it at the time …
Posted on in Programming
Although I was getting this output in relation to one of my Jinja2 templates, it really isn't a Jinja2 problem.
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 69: ordinal not in range(128)
The bit of code here should be doing nothing more than printing a float …
Posted on in Programming
I've mentioned before that
empty strings in Python are false.
This leads to a common if not string paradigm. Unfortunately, this can be
problematic. Check out this snippet:
>>> string = ""
>>> if not string:
... print("empty")
...
empty
That pretty much worked out just as we imagined. The empty string returned False
and …
Posted on in Programming
Although I use Git all day long, I actually prefer to use Mercurial for my personal stuff. When I started working on this project to maintain slaptijack.com with Pelican rather than continuing to use Wordpress, one of the things that really interested me was the ability to keep Markdown …
Posted on in Programming
This is was my next project.
Update: For now I've solved this problem by using FeedWordPress to pull the Atom feed for the Pelican-specific portion of the website.
Posted on in Programming
Posted on in Programming
Sometimes this pops up when you least expect it:
Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.
This morning, I went to refresh one of my git repo's for work, and make spit
that out. What the heck happened last night? Anyway, the …