archives | rss
  • 05.13.2013 Hockey Hall of Fame

    Last month I took a work-related trip to Toronto and made a pit stop at the Hockey Hall of Fame. Here is a link to the photos I took while I was there. If you ever get the chance I highly recommend it.

    Untitled

  • 02.21.2013

    fuckyeahhockey:

    Ants

    maelstromantic:

    Remember that time everyone forgot how to play hockey at the same time?

    It happened again.

    Saw this while it happened the last night. It was hard to tell these were professional hockey players.

  • 02.07.2013 Using RedBean to Add Data for Unit Tests

    Recently while keeping my mind alive in my free time, I took a PHP project I created last year and decided to add tests around it. Basically I wanted to test an HTTP API confirming that POST and GET requests were working and that data was being inserted into and retrieved from a database. I’ve very much an amateur when it comes to this kind of thing (thus why I am doing in first place) so I had to do some research.

    One of the first things I need to set up was the test data. Granted I could of just used the API to do the testing and confirm the results but I wanted to test each alone (this is where the unit part comes in). One way to do this would be to create a test database and the scripts to insert data to test and delete it once the test is over. Another option would be to use mock objects but since there weren’t really any classes involved with this app I couldn’t really figure out a good way to do that.

    This is where RedBean came in. Their wikipedia entry does a good job of explaining what it can do. I started using this for the database abstraction stuff in the API code and it turns out it can do much more. Not only can you interact with the data with it but you can create tables, even databases right on the fly. Then you can also delete them on the fly.

    The following example creates a table named message. This is all my application uses so this is another reason why it worked so well in this situation. The one thing you have to make sure is that this table does not exist prior to this so you have to create a property for each column. Otherwise you’ll get an error trying to insert into data into a column that doesn’t exist. This forced me to change a couple of things in my code. Also, this will insert an extra record for the test data, so you will have to either delete at the beginning of each test or ignore it.

    $message = RedBean_Facade::dispense('message');
    $message->app_name = 'application name';
    $message->body = 'message body';
    $message->type = 'message type';
    $message->posted = RedBean_Facade::$f->now();
    RedBean_Facade::store($message);
    

    Then once you are done with the data, you can delete it. I ended up putting the following line in the tearDown() method which deletes the data from message and drops the table.

    RedBean_Facade::nuke();
    

    If I had to write a new PHP app I would definitely consider using RedBean for the ORM. One thing I found a little frustrating was the documentation. There is some out there but it seems to be a little lacking. Luckily there seems to be a pretty good community of users that make up for it.

    Also, composer.org support seems to be an after thought. It appears that the author doesn’t use it. This caused a couple of quirks including losing the ability to use the R class directly. An easy workaround to this was just adding the following line to my code:

    use RedBean_Facade as R;
    

    Hit up RedBean’s website for more information.

  • 02.04.2013 carinteriors:

1987 Cadillac Fleetwood Presidential Limousine concept

    carinteriors:

    1987 Cadillac Fleetwood Presidential Limousine concept

  • 01.28.2013 Install Python 2.7 (homebrew + pip + virtualenv) on OSX

    In case I need to reinstall pip again. What a pain in the smoker.

  • 01.20.2013

    I went on a brewery tour last weekend and it was fun.

  • 01.06.2013 Top 10 records of 2012

    2012, like any year, didn’t disappoint in the music department. I was contemplating making one of these lists this year. I guess the main reason I am doing it is more a to create a list of what I listened to this year and suggest you check them out if you haven’t already. I did listened to more music than this over the course of the year, but these ones stood out. So without further ado, here are my favorite records of 2012.

    The Snips: Highs of Low - I’d only heard of The Snips prior to listening to this record. I heard a song on a podcast in the spring and went to check it out. Turns out the record is free to download off their website so began listening right away. I instantly became a fan. The sounds are very melodic and I love the singers voice. I ended up revisiting it many times throughout the year.

    The Holy Mess: Cande Ru Las Degas - I knew these guys were recording at some point and was anticipating this release. It didn’t disappoint at all and is probably my favorite form the list. Good old gruff punk from Philadelphia.

    Propagandhi: Failed States - These guys keep taking each record to the next level. I know I am probably in the minority but I liked their last record (Supporting Caste) better. Some of the song’s lyrics are somewhere I can’t get to and don’t really want to. With that being said I think musically they hit it out of the park with this one.

    Menzingers: On the Impossible Past - I loved their last record and this one was a bit more polished. The songs were a little slower and it took me a bunch of spins for it to click but it finally did. The final product is, to me, timeless.

    No trigger: Tycoon - If you read my blog you know I’ve not only been anticipating this record but hyping it as well. Even though they haven’t put out a record in like 7 years it’s as if they never missed a beat. Which make me think how ahead of it’s time Canyoneer was. Every song on this record is great.

    Bruce Springsteen: Wrecking Ball - What can I say? I’m a bing fan of The Boss but haven’t been blown away by anything he’s put out in the last 10 year. This record was an exception. The song Wrecking Ball is one of those that I think could live on forever.

    Teeange Bottlerocket: Freak Out! - I don’t know why it took me so long to get into this band. Gratned the super poppy punk has been done a million times but these guys nail it. Even the jokier songs are good. If there is one band I want to see live in 2013 it’s these guys.

    Daytrader: 12 Years - This was kind of a guilty pleasure. Even though I kind of dug the E.P. they put out last year I saw them play a show and was unimpressed . This full length was a great next step for the band. It has some super catchy songs on it. It’s too bad they broke up before the year was over.

    Anchors: Lost at the Bottom of the World - Another solid release from a band that I don’t think gets much love from the media. I had no idea this record was out until near the end of the year. Every song is solid. It’s just good, catchy, fast punk that seems to be missing these days.

    NOFX: Self-Entitled - To me, NOFX hasn’t released anything groundbreaking in the last 15 years but I do own and really like everything they’ve done. This record was great. It was was simple with no joke songs. You can hear many Bad Religion influences throughout it. It had a rawness to it as well that created a refreshing, back-to-basics sound.

  • 01.01.2013 2012

    Well, 2012 is officially over and I wanted to highlight a few things that happened this year.

    Winter/Spring

    • In January I started a new job. So far so good
    • In February I played in a hockey tourney in Ludington then the Labatt version in Kalamazoo in May.
    • In March I attended my first Hackthon put on by the crew behind Startup Zoo. I had a great time and met a bunch of people. I hope to participate in more events like this next year.
    • In May some of my pals and I saw Mastodon rock the Intersection. It was stoner metal to the max.
    • In June I took a trips with the in-laws to Denver, CO. It was my first trip out there. I saw the rockies, tapped them and ate an awesome burrito.
    • I saw Against Me! play for the second year in a row. This year with the newly unveiled Laura Jane Grace and they blew me away like usual.
    • Later in June I spent a week in Brighton, MI for work. Most of it was spent in the same room. IT was enough to make you got nuts but I got to know my team mates pretty well.
    • The first week in July I turned 30 and went to Vegas we my best pals. What a blast that was.
    • Later in July we took a cabin run to Bear Lake for the first time in a couple of years. Of course, we made a pit stop at Rosie’s
    • In September Zig was born.
    • In October Protected Left Record our first full length record.
    • In early November I finally saw Propagandhi in Chicago. It was my first and only trip to Chicago for the year and my first time seeing Propagandhi.
    • In December, Protected Left came to an end and we played our last show. It’s been a fun couple of years.
    • I also bought a MacBook Air in December. It was long overdue and I love it.

    Not to go unnoticed, I did write some code over the year. Here’s a list of projects I created:

    • Joeno - I finally attempted a node.js application. I gave up on it early in the year because of time but plan to finish it next year.
    • TwitterPyBot - This is a bot that find follows people on twitter based on what they tweet about.
    • The Official David Lee Soundboard - A collection of audio clips of my pal Dave using twitter bootstrap and the jPlayer jQuery plugin.
    • Highfashion - A server for logging messages remotely via HTTP.
    • Tweenis - This has been out there a while but I had some downtown while in the hospital when Zig was born and they had free wifi. So I converted the site to use backbone.js.

    As always I am looking ahead to 2013. This year with Protected Left done I think I am going to take a back seat to the music thing (at least for a few months) and focus on software development (that and of course raising my child). I want to get more involved with the local tech communities, write more code and contribute to an open source project. I also have a few trips in the making. I may finally get to see the west coast of this great nation!

    So heres to 2012. It’s been real.

  • 12.28.2012

    One of my favorite songs of 2012. Happy New Year!

  • 12.27.2012

    Protected Left made a video.

« Previous Entries