Posts

Quick Tip: Duplicate a Table in MySQL

If you need a quick way to duplicate a table (for testing or whatever) it's as simple as:

CREATE TABLE newTable LIKE oldTable;
insert into newTable select * from oldTable;

Quick Tip: See Local Commits That Haven't Been Pushed In Git

If I'm switching between a couple projects a lot (which I have been this week) I try to run git status whenever I start working in a project again. Usually, it's just the files I have failed to commit because I was working on something "really quick" but today I was presented with the following:

# On branch master
# Your branch is ahead of 'origin/master' by 3 commits.
#

I was of course confused because I didn't remember what it was that I changed but didn't commit. In order to check this I ran the following command which
gave me exactly what I was looking for:

git log origin/master..HEAD

Only You Can Prevent Zombie Code

I've had to take over a lot of crappy code bases in my life and they always have their problems. Poor class (or lack thereof) structure, poor error handling, crappy UIs, lack of unit testing, and the list goes on. One of the more difficult things to deal with is the code that has, for one reason or another, been left in the code base but doesn't actually run. This is called Zombie Code because, much like the popular monster, it's not really dead and it's not really alive it's just there waiting to bite your face off when you least expect it (by deleting hundreds or thousands of records). Here are some of my favorite varieties. Read More

Link Post: Triangulation 125: Ladar Levison

Another interesting interview on Triangulation. This time it's with Ladar Levison who is the creator of a secure email service called Lavabit. Lavabit was used by Edward Snowden which caused it be noticed by the FBI and was then shutdown by Ladar in order to prevent his secure email service from being not secure. It's interesting if you've followed the NSA revelations and a nightmare if you're a business owner in the US. He was basically treated like a criminal and because of the heavy handed surveillance we seem to be allowing forced to close his business.

http://twit.tv/show/triangulation/125

Learning Goals For 2014

Every year I try and look at the state of website development and set some goals to help me expand my skills. I try to make these goals learning technologies that I think can help me do things better/faster but are hard to bill to a specific project/client.

Here are my goals for 2014:

1. Create and maintain a website using Zend Framework 2

This was a goal last year but it just never got off the ground. I'm happy to say that I have an idea and a process down and this is going to be one of my priorities in the coming months. I must say ZF2 is much harder to work with then ZF1 but I'm learning and it seems much more powerful.

2. Create and maintain a website using Grunt

After reading the Automating Front-end Workflow deck that I posted last year, I've become very interested in using Grunt to process my SCSS, JS, and image files. I've started some work on this and hope to have some blog posts shortly on this awesome technology.

3. Unit Testing

Another goal from last year but I've seen the light and now I just need to make it so.

4. Learn how to create sites that "scale out"

This is more of a work goal because we're starting to have a hard time taking down our servers to perform maintenance on them and we want to create a highly available website. We've already run into a couple problems with just porting over our current codebase.

Install New Packages With Vagrant Without Losing Your Connections

The normal vagrant reload process cause the following things to happen:

  1. VM is shut down
  2. VM is started up
  3. Provisioning occurs (software/packages are installed)

This is a great process because it clears everything out and resets your VM to a good state. It's a sucky process because step 1 causes SSH and other long term connections to disconnect and potentially fail.

If you use vagrant provision it only causes step 3 to occur without restarting everything. It's also much quicker when your learning how to do things with vagrant. I've spent some time the last month learning new things and it's been a real eye opener.

Link Post: Triangulation 121: Grant Imahara

This is only vaguely programming related but TWiT.tv's Triangulation show has an interesting interview with Grant Imahara who is one of the Mythbusters. He actually used to work for ILM and was one of the people who worked on R2-D2 and created the Energizer Bunny that they used in commercials (I don't have cable anymore so maybe they still do).

It's an older show but I'm super behind in my podcasts. :-)

http://twit.tv/show/triangulation/121

Happy Holidays From TPT!

Unless something earth shaking happens this is going to be the last post for 2013. I thought I would spend some time reflecting on 2013 and set some goals for 2014.

My goals was to create 52 new blog posts with new content (non-link posts) and I created 60 new blog posts. My plan for next year is to maintain this and continue to create quality posts and not push it and create a lot of crappy posts.

Looking back through Google Analytics my best posts this year have been my longer posts that explain how to do things so I'm going to focus on writing longer focused posts and series focused on a piece of technology. We'll have to see how that works out. :-)

Accessing Your Private Network Vagrant VM Remotely

Vagrant and PuPHPet.com makes it super easy to create new virtual machines but it's not always easy to access them from another device. On my home network, I usually create the VM on my laptop so I can work on a site when I'm on the move but then I use my desktop with the nice keyboard and dual monitors to work on it. Then I like to test on my tablet/iPod so I can actually see what a site looks like on a smaller screen. The default setup doesn't make this the easiest process. Read More

Link Post: Calendar Tables: An Invaluable Database Tool

An interesting article about creating a table filled with dates and any special meaning they might have to help generate reports. This will be helpful for a project I'm working on.

http://www.brianshowalter.com/calendar_tables

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