Categories
post

My First Experience at the @OrlandoPHP Coding Dojo

I attended my first coding dojo last night for our Orlando PHP Meetup.

Boy was I confused. In my mind I was thinking the javascript library Dojo. I thought maybe they used Dojo as a front end to a PHP backend, and just did some coding samples. I have been wanting to use Dojo (the javascript library) lately, so that is why if was top of mind.

The coding dojo is interesting. Simply put, it’s like a karate dojo, in the sense that it is a programming practice. Pick a simple problem, lay the groundwork, and start developing. Not start coding. They guys running the group stress good TDD (Test Driven Design) practices, which was great. I heard many people last night say something to the effect that the project will take twice as long, because you are writing twice as much code.

While I feel I am a decent programming and make a living, I realize that there are many new programmers that come to these meetups. It was nice to feel like I was contributing to someone else’s learning. I was able to relay some of my personal experience with spaghetti code that I am working on untangling now. TDD is the best way for me to untangle the mess.

All in all, I prefer the presentations when they have them. I have volunteered to do one (I want to improve my speaking skills). I may not make all the dojo’s, only because I drive an hour each way, however I will definitely contribute to others learning when I can.

Thanks #OrlandoPHP

Categories
post

Top 10 Nerdy Music Video Parodies

@SnipeyHead tweeted this link out and I found all the videos great. A couple I have seen before, but they were all great to see. This is probably my favorite of the bunch.

Top 10 Nerdy Music Videos & Parodies

Categories
post

Git and Git Flow Usage

I saw this image about a successful git branching model. http://nvie.com/posts/a-successful-git-branching-model/

It made perfect sense while looking at the graphic, however implementation proved to be more difficult for me. I am a one man shop, so it is too easy to get confused when I don’t have to worry about other developers.

I then saw a tweet about Git Flow. I didn’t put two and two together that it involved this very image. If you are considering Git and looking for a good routine, definitely look into this.

https://github.com/nvie/gitflow
Why aren’t you using git flow?

Also look at the bash completions, I highly recommend them.
http://github.com/bobthecow/git-flow-completion

Categories
post

PHP Fatal error: Call to undefined method PHPUnit_Util_Filter::addFileToFilter() in /usr/local/bin/phpunit

I all of a sudden started receiving this error with no clue why. Numerous posts I read told me that I should downgrade from 3.5 to 3.4, which turned out to be a huge P.I.T.A.

The solution, look for the reason on the system. Turns out, my older version was installed in /usr/local/bin/phpunit, w here as the new version was just /usr/bin/phpunit.

Simply delete the old one, and if necessary, symlink the two together.

Categories
post

Drobo

I have been using a Drobo and DroboShare for almost two years now and have been very happy with it. I have used it to replace a windows machine that I was using just as a file share.

The one I have is kind of slow over the network. I know the newer versions are faster. I just deal with the speed, in the long run, it doesn’t bother me that badly. And for doing backups, it’s amazing.

What is a Drobo? Click Here to Find Out

Categories
post

Conditional Statements in Mysql (if/case/etc)

I never really thought to ask the question, but was shocked to see you can do simple conditional statements in Mysql. This will make my querying far better than in the past. Plus I can pull quick data when needed instead of writing a script to analyze it.

Example, trying to find out if an order was placed in our callcenter or on the web:

SELECT orderDate, if(ipAddress = ‘XXX.XXX.XXX.XXX’, ‘CallCenter’, ‘Web’) as WherePlaced, count(*) as cnt FROM orders GROUP BY orderDate, WherePlaced

Simple, but only useful if you know about it. Now I do. 🙂

Categories
post

Getting Counts For Groupings From Mysql

My dad “beto” asked me about a topic he would like to use on his website.  I decided to share it publicly.

He has a simple select box that stores a “Yes/No/Maybe” option in a table.  He wants to include the results on a webpage.

I have to assume his Mysql table (let’s call it ReunionAttendance) has at least two columns (SelectBoxValue, GuestsAttending).  Adjust the field names for the actual table columns in your table.

There are many ways to do this.  I am going to do it this way for a demonstration:

<?php
/*  Steps needed
1) Get data from table
2) Put data into a variable
3) Display the table via HTML
*/

/* 1 */
$result = mysql_query(“SELECT SelectBoxValue, SUM(GuestsAttending) as Attending FROM ReunionAttendance GROUP BY SelectBoxValue”);

/* 2 */
while (list($comingValue, $comingCount) = mysql_fetch_row($result)) {
$list[$comingValue] = $comingCount;
}

/* 3 */
?>
<div id=”WhosComing”>
<table>
<thead>
<tr>
<th>Coming?</th>
<th>Total</th>
</tr>
</thead>
<tbody>

<?php
foreach ($list as $comingValue => $comingCount) {
?>
<tr>
<td><?php echo $comingValue?></td>
<td align=”right”><?php echo $comingCount?></td>
</tr>

<?php
}

?>

</tbody>
</table>
</div>

Categories
post

Do You Foresee Any Problems With This Approach To YouTube Videos?

I am trying to squeeze every excess byte out of my downloads. I noticed that even with the iFrame version of YouTube videos, users have to download almost 200K worth of data.

I decided to use the screenshot stored at YouTube (replace all occurrences of VIDEOID with a youtube video):
http://img.youtube.com/vi/VIDEOID/0.jpg

HTML:

 

<div align=center id='vidVIDEOID' stlye='clear: both; margin:0; padding:0;'>

<img class='YouTubeScreen' rel='VIDEOID' src='http://img.youtube.com/vi/VIDEOID/0.jpg' border='0' />

</div>

And use jQuery javascript like this:

$(".YouTubeScreen").click(function(e) {

var vid = $(this).attr('rel');

$("#vid" + vid).html('<iframe title="YouTube video player" width="640" height="390" src="http://www.youtube.com/embed/' + vid + '?autoplay=1" frameborder="0" allowfullscreen></iframe>');

});

Categories
post

How to Play/Pause iTunes With Your Magic Mouse

This was one of those things that I couldn’t believe the Magic Mouse didn’t handle automatically for you. However, you can install Magic Prefs for free. With in there you can add ActionScript. It isn’t very clear how to do this.

First copy this to your clipboard:
tell application “iTunes”
playpause
end tell

Then, choose a mouse action, follow menus down to Custom Actions => Manage ActionScript
Just type a name into the top box and click the +

You will then see it in your list of available actions for the mouse.

Categories
post

BugZilla should be renamed

We use bugzilla internally for so much more than a “bug” reporting system. I have done internal presentations about the product and have jokingly called it OrganiZilla or TicketZilla.

The software offers fantastic Organizational qualities to help us stay on top of tasks. And once you get past the idea of bugs and call them tickets, you realize that there is a much broader use of it.

From updates on a website to telling someone to take out the trash, it works! But only if everyone is on board.