**Disclamer: ** I’m sure MySQL database administrators will tell me that this is SUPER wrong because I should always let the database engine pick what indexes to use but this feature exists for a reason. That being said I’m NOT a database administrator I’m just a programmer that plays one on TV.
The other day we ran into an issue where a page would take about 60 seconds to rendering and the problem was tracked back to a single query. Lets say it looked like something like this:
INNER JOIN Table2 ON Table2.id = Table1.Table2Id
WHERE Table2.column = 'true';
When I ran
explain on the query I got the following:
I’ve never seen it use intersection before and I had a index set for all the columns I was using. In MySQL you can force it to use an index:
INNER JOIN Table2 USE INDEX (column_idx) ON Table2.id = Table1.Table2Id
WHERE Table2.column = 'true';
This simple change took the query from 60 seconds to 0.5.
An overview of some of the more important improvements to PHP7. I’m super happy to see the
mysql_* functions going away.
An overview of how you should be adding indexes to your MySQL tables.
Horrible take away from this article:
I love the way they tested this:
So @tombaromba hacked some code in the GOV.UK homepage (similar to an approach inspired by an experiment Yahoo! Conducted in 2010). We chose this page because of its high volume of traffic and low likelihood of any bias towards a particular user group or demographic.
This code included three images, of which browsers should request two.
First, an image that virtually all browsers would request (the ‘base image’).
We deployed this code and then collected the log data from over half a million visits. I expected that number of ‘base image’ requests would closely equal the combined ‘script image’ and ‘noscript image’ requests.
I’m curious what the numbers are for sites I manage…
I wish more sites would get behind this:
User identity is always email, plain and simple. What happens when you forget your password? You get an email, right? Thus, email is your identity. Some people even propose using email as the only login method.
This is the scariest one in the bunch:
Remove all local untracked files (and directories) from your local clone
Careful! You might want to take a backup before doing this:
git clean -f -d
A good overview of why you should be using a static asset pipelines but it doesn’t go into enough details to actually be helpful.
A curated list of resources for learning about application security
The main topics of this cheatsheet include an intro to the shell, navigating around the shell, common commands, environment variables, connectors, piping, I/O redirection, permissions, and keyboard shortcuts.
I’ve been trying to figure out how to communicate Podcasts and links that I found to be informational or interesting but I don’t want to clutter up my site with junk so I’m going to start creating roundups every month so I can still communicate these but not have 100 one link posts.
This sounds like a really interesting Agile project management system. I’ve created an account and it looks amazing.
This Week In Startups
This is a really interesting presentation about a bunch of topics that are important if you’re creating a project. I’ve listened to it twice and I’ll keep coming back to it. I might even listen to it again and post my notes. It was packed with information.
Sound of Symfony
An overview of various tools use in PHP development. I’m always looking for better tools to improve my work.
An interesting overview of command buses.
TIL a11y = Accessibility because it starts with an “a”, ends with a “y”, and has 11 characters in between.
Accessibility is one of those things that I think I should do more with but never do. I’m really going to make it a goal to get my stuff together and test my sites for accessibility.
Bletchley Park is where Turing helped create the computer that broke the Enigma. This interview talks to one of the people who was involved in converting it to a mueseum and clears up some inaccuracies in The Imitation Game (a great movie if you haven’t seen it yet)
We just finished hiring a new programmer at Zimco and almost all of the candidates we got were white men (a lot of that is due to our office’s location in Mid-Michigan). It was interesting to hear two separate podcasts that discussed diversity hiring within as many days.
- Stack Exchange Podcast #64: Diverse Hiring and a Cat Named Alan Turing
- Improving Diversity in Tech with Ashe Dryden & Faruk Ateş
When your users share something on Facebook they get something that looks like this:
One of my clients had a problem where the text that was showing when sharing a page to Facebook was wrong and I learned two things.
- It’s very hard to test this using the normal front end.
- Facebook caches information about your page.
The link below give you access to see what Facebook is getting from your site so you can fix any issues and force an update to clear the cache.
The thing I find most interesting is that Facebook is finding this winking smiley face on the TPT home page:
When you’re developing websites it’s very easy to create a small subset of data so you can test but there are some performance issues and bugs that will only rear their ugly head when you have a large amount of data. It’s very difficult to create this test data and have unique values set. You could just fill your database with random letters and numbers (
substr(sha1(gmdate('U'))), 0, 10) but it’s better to have nice looking data if you need to demo changes.
The Faker library provides a way to generate fake but real looking data for your test environment.
At Zimco, we’ve started working on standardizing our coding but we ran into a little problem while we tried to automate the process of making sure our code adhered to that standard.
I have a love/hate relationship with passwords and it’s interesting to see what the common passwords are.
I’ve been working with Symfony for a couple projects and I’ve been super happy with the documentation. It seems like every time I do a search for something that I’m stuck on the project has already had a piece of documentation. It’s nice to see they have this cool demo application that’s using their best practices. It’s super basic but it’s a nice reference.
Composer is great because you can easily add libraries to your projects and have it automatically pull down the same versions for every deploy of your site. The downside to composer libraries (and open source in general), is that sometimes it’s hard to get your pull requests for bug fixes merged into the master so you can use it on your project or add your own customizations. You can fork the repository in order to gain more control over the source.