Posts

Link Post: Zero to 95,688: How I wrote Game Programming Patterns

I haven't actually read the online book (I did read the chapter on the Game Loop that's referenced in this article but this article is a really cool story about creating something really massive.

I really like this piece of advice and agree that this is how you get things done:

Around this time, I’d stumbled onto that article about Jerry Seinfeld’s trick for staying productive. It’s pretty simple: work on it every single day. Don’t break the chain of sequential days.

http://journal.stuffwithstuff.com/2014/04/22/zero-to-95688-how-i-wrote-game-programming-patterns/

Quick Tip: Display MySQL Results Vertically

When I'm working on a remote server it's sometimes useful to get data out of mysql using the command line mysql client (don't EVERY install phpMyAdmin on a public server) but it's hard to read data from tables that have lots of columns.

Normally, you end up with something like this when you terminate your command with a semicolon (;):

SELECT * FROM User WHERE id = 13;

Screen Shot 2014-04-30 at 10.28.48 PM

But if you terminate your command with a \G you end up with the same data in a much more readable format:

SELECT * FROM location_cities\G

Screen Shot 2014-04-30 at 10.29.07 PM

Set the Session ID While Performance Testing With ab

I was working on fixing a performance issue on a page that requires a login to work. To work through the issue I wanted to send a bunch of requests to the page using ab but need to have the user logged in. In order to do this you can specify a cookie value using the -C parameter:

ab -C PHPSESSID=co1d400krhndtumi5orsfr70c4 -n 10 -c 10 http://hostname/controller/action

Podcast Updates: Omnibus Edition

Between the new addition to my family and health issues I've gotten super behind on my podcasts. I've recently started walking again at night so I've made progress in my giant list of podcasts and I wanted to highlight some episodes that I think people should be hear/watch. I should point out I listen to all of these so I can't comment on the video.

nginx

FLOSS Weekly has an excellent podcast on nginx (pronounced Engine X). I've heard about nginx a lot recently and read about it in the Scaling PHP Book and I'll be looking into using it for when we upgrade our servers this summer.

http://twit.tv/show/floss-weekly/283

iOS Security

Security Now has a set of episodes that explain [http://images.apple.com/ipad/business/docs/iOS_Security_Feb14.pdf](this document) that Apple released about security in iOS. Steve read through the document and talks about each piece. I think it creates the gold standard for how we should treat our user's data and it's awesome that Apple is willing to share this information.

I should warn you these total about 6 hours so I wouldn't plan on sitting down and watching them all in one go but they're nice to listen to.

  1. iOS Security
  2. iOS Security, Pt.2
  3. iOS Security, Pt.3

Heartbleed

Another Security Now set of episodes that discuss the Heartbleed vulnerability.

  1. How the Heartbleeds
  2. TrueCrypt & Heartbleed Part 2

Jasmine

Finally, I listened to this podcast about Jasmin for unit testing JS which I'm currently evaluating for my projects.

http://hanselminutes.com/412/getting-started-with-javascript-unit-testing-with-jasmine-and-rushaine-mcbean

Link Post: How 'DevOps' is Killing the Developer

Not every company is a start-up. Start-ups don't make developers wear multiple hats by choice, they do so out of necessity. Your company likely has enough resource constraints without you inventing some. Please, don't confuse "being lean" with "running with the fewest possible employees". And for God's sake, let developers write code!

An interesting article, any company that's of a decent size shouldn't be pulling this crap and I'm guessing if they're having their developers to do this then they're also a shitty place to work.

http://jeffknupp.com/blog/2014/04/15/how-devops-is-killing-the-developer/ via Reddit

Link Post: 75 Essential Cheat Sheets for Designers and Programmers

I didn't even know some of these were things (Google Chrome Plus) and I've seen a few before (I had the JavaScript and CSS ones printed out when I worked at the NSCL) but the HTML5 one looks really nice and I might actually print it out until I learn the new tags (and unlearn the old ones :-) ).

http://designzum.com/2014/04/03/best-cheat-sheets-for-designers-and-programmers/

Link Post: The Zen of Application Test Suites

This article talks specifically about testing Perl but most of the concepts are relevant to all languages.

I think this is the important point:

[W]hat features do we want to see in large-scale test suites?

  1. Tests should be very easy to write and run
  2. They should run relatively quickly
  3. The order in which tests run should not matter
  4. Test output should be clean
  5. It should be obvious where to find tests for a particular piece of code
  6. Testing code should not be duplicated
  7. Code coverage should be able to analyze different aspects of the system

https://github.com/Ovid/zen-of-test-suites

Quick Tip: Generating SQL Files From Your Doctrine 2 Entities

In order to generate the SQL for any changes in your Doctrine 2 entities run the following command:

vendor/bin/doctrine-module orm:schema-tool:update --dump-sql

Link Post: How I Lost My $50,000 Twitter Username

Yet another reason to stop using GoDaddy and PayPay.

My claim was refused because I am not the “current registrant.” GoDaddy asked the attacker if it was ok to change account information, while they didn’t bother asking me if it was ok when the attacker did it. I was infuriated that GoDaddy had put the burden on the true owner.

https://medium.com/p/24eb09e026dd

Quick Tip: Downloading Large Files Through PHP

We wanted to provide a secure download feature to one of the sites I work on and it worked fine with smaller (< 1MB) files but when we tried large files (>550 MB) it would just output a empty file. After some troubleshooting (and a helpful post on php.net) it turns out that because output buffering was enabled it was running out of memory. This is the code that allows for the download to succeeded.

header('Content-type: application/x-gzip');
header('Content-Length: ' . filesize($filename));
header('Content-Disposition: attachment; filename="' . $file . '";' );

ob_end_flush();
readfile($filename);
exit;
RSS

Join Our Mailing List!

View previous campaigns.

Top Posts

  1. Working With Soft Deletes in Laravel (By Example)
  2. Fixing CMake was unable to find a build program corresponding to "Unix Makefiles"
  3. Upgrading to Laravel 8.x
  4. Get The Count of the Number of Users in an AD Group
  5. Multiple Vagrant VMs in One Vagrantfile
  6. Fixing the "this is larger than GitHub's recommended maximum file size of 50.00 MB" error
  7. Changing the Directory Vagrant Stores the VMs In
  8. Accepting Android SDK Licenses From The OSX Command Line
  9. Fixing the 'Target class [config] does not exist' Error
  10. Using Rectangle to Manage MacOS Windows

subscribe via RSS

All content copyright This Programming Thing 2012 - 2021
Blogging about PHP, MySQL, Zend Framework, MySQL, Server Administration and Programming in general