Friday, May 8, 2015

MySQL Batch Updates Not Working

Looking at "SHOW PROCESSLIST" and it looks like your queries are running individually instead of in batches like you sent?

This happens because MySQL runs each update statement individually, but you should still be able to see the batches when the queries are in the "init" state.

Use this query to see the batched queries:
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST where state="init";

Sunday, March 22, 2015

Thursday, February 12, 2015

"Error response from daemon: 404 page not found" - Docker

This required setting the following in my /etc/environment:
no_proxy=/var/run/docker.sock

Wednesday, January 28, 2015

When Not to Use Generator Expressions

http://stackoverflow.com/a/26635939

I found that post very helpful. I didn't know it's a better idea to use a list comprehension rather than a generator expression for "".join().

mod_wsgi + Flask

Here's my mod_wsgi configuration for a flask app that uses Flask-Admin.

Trailing slashes matter! If you set a trailing slash, it will only set the alias for that directory and not all of the directories below it.

Monday, January 26, 2015

Request.Args Empty During Tests - Flask

https://github.com/mitsuhiko/flask/issues/801#issuecomment-21513278

If you're using app.test_client().get, it's very important to use a relative url or your parameters will be removed.

# will not pass request.args
rv = self.client.get('http://0.0.0.0:5000/view/?foo=bar')

# works just fine
rv = self.client.get('/view/?foo=bar')


Thursday, January 22, 2015

Self-Hosting Fonts

https://github.com/CSSLint/csslint/wiki/Bulletproof-font-face

That's the most helpful guide I found for self-hosting your own fonts and preventing compatibility issues.