Legacy Browser Detected! This website requires a browser that supports HTML5 and CSS3 to reach its full potential! Download Google Chrome, Firefox, or Opera for your laptop, desktop, or mobile device.

Swivelgames.com

Development, Gaming, Life.

Swivelgames.com and The muir Project
The muir project is gaining momentum. Not long from now it will be in a usable state. Currently, this website uses the first version of my templater engine I wrote. Since this site has been updated, there have been three new versions written. The fourth should be finished soon, which will prepare this project for its first trial run and RC. Wish me luck!

Fancybox, the Dreadful jQuery lightbox, and Improper Modal Resizing for iframes

Among the many problems I've encountered in fancybox, I found a solution for a rather annoying issue. An issue a colleague and I, and apparently many of you, ran into recently was navigation within a fancybox iframe does not resize the fancybox height.

Now, mind you, it was neither my idea to use an iframe in the first place nor was it to have all this navigation taking place within it. The issue arose when navigation to a shorter page resulted in the modal no longer being centered vertically on the screen and the fancybox shadow didn't move to fit the new screen.

A quick fix was all it took.

It's important to know that jQuery's load() method is executed every time an iframe's src attribute is changed (i.e you click on a link inside the iframe). Just knowing this, you can problem make an estimated idea as to where I'm going with this. With our new old knowledge of jQuery's load() event listener method thing, we can begin exploring incredibly complex algorithms we can utilize to construct our load statement.

Hmmm... lets start with this:

jQuery("iframe#myIframeId").load(function(){
alert("*gasp* You navigated!");
});

This simple set of commands will issue you an annoying popup every single time you navigate within your iframe. Consequently, you'll become annoyed, frustrated, and possibly get a headache and not want to work on your code ever again. So, on second thought, lets not use that code. Instead, we must dive deeper.

I explored assigning fancybox' resize method to my iframe's load event after $(document).ready(), but quickly realized how silly that sounded. Knowing, that the iframe doesn't actually get added to the page until the use attempts to open the fancybox modal. Not to mention fancybox' resize method only actually resizes the overlay, and doesn't even touch the modal.

Without thinking about adding this assignment to every fancybox button I have on every single page, I decided to edit the core of fancybox. It was a relatively simple task. Goal: Search for anything related to iframes and delete those lines! Wait, no, don't do that. Instead, we'll slap our code on the end of the _show method like so:

jQuery('iframe#fancybox-frame').load(function(){
$.fancybox.resize();
});

If you hadn't noticed previously, I did decide to use fancybox' resize method, but with a tiny revision.

To be annoyingly repetitive I revised the _finish method as well to read (on lines 618-620, if you've been following the revisions):

if (currentOpts.type == 'iframe') {
$('<iframe id="fancybox-frame" name="fancybox-frame' + new Date().getTime() + '" frameborder="0" hspace="0" ' + ($.browser.msie ? 'allowtransparency="true""' : '') + ' scrolling="' + selectedOpts.scrolling + '" src="' + currentOpts.href + '"></iframe>').appendTo(content).find('iframe#fancybox-frame').load(function(){$.fancybox.resize();});
}

If, for some very odd reason, you're unable to read that incredibly legible code, I simply appended the iframe line to find the iframe and slap the load even on to it.

Now for the good stuff: turning all four (4 (four (4 (four)))) lines of fancybox' resize method and turning it into an enormous 4 lines larger!

Replacing line 1009 with this will create the illusion that you actually contributed to making fancybox a better jQuery plugin.

$.fancybox.resize = function() {
if (currentOpts.type == 'iframe') {
var iframeHeight = jQuery('iframe#fancybox-frame').contents().find("body").height();
wrap.css('height',iframeHeight);
}


Then, to feel even more cool, you can minify your new source and share it with your friends! How cool is that?

To wrap things up, and to understand how terribly you just destroyed your once-vanilla, now-melted version of fancybox, you really just made it so that whenever you navigate your iframe, your modal wrapper will always change to fit the size of your iframe's page.

If you want to limit the size of your modal window (for instance, if you've got scrolling) you can use the following code to adjust the modal's window no larger than the visitor's viewport size:

if (currentOpts.type == 'iframe') {
var iframeHeight = jQuery('iframe#fancybox-frame').contents().find("body").height();
var viewportHeight = jQuery(window).height();
var setHeight = iframeHeight;
if (iframeHeight > viewportHeight) {
setHeight = viewportHeight-40;
}

wrap.css('height',setHeight);
}

Happy coding! And remember, if you have a say in it, always use jQueryUI. Thanks for reading my obnoxiously long post.

// sent on October 25th, 2011 at 17:27:32...



Fame by Warfare

War is neither a game, nor a limbic reaction anymore. It is a thriving industry. One that we as a country— a generation have turned into a culture; a society fueled by propaganda and a munipulated tax enterprise. Why do we go to war? Because its almost all we know as a country. This country will see freedom once again when we loosen our grip on the arrogant idiologies and "values" that we see necessary to cling so tightly to. We cannot continue to be afraid of change. We the people are no longer free. We are slaves to this sickening addiction to fame by warfare.

I love knowing we still have an opportunity to redeem ourselves, but only if we remind ourselves of the roots and goals this country *is* founded on. Those values are timeless. We the people don't run this country anymore, the largest corportion in the world does: the United States Government. We're simply its cheerleaders.

// sent on October 18th, 2011 at 23:54:41...



Finally... Internet

I thought I would never say this, but I have finally achieved Interweb-having status. Unfortunately for me, and AT&T, the relationship between AT&T and I could not work itself out. A top the endless perks and promos was an ugly face staring at me saying "My name is AT&T and I am a bloated corporation hell bent on making your experience as our customer and a fellow Internet user an eternal Apocalypse." Despite trying my best to completely ignore the warning signs I was perpetually being slapped with, I decided to give AT&T FIVE tries to come out and even INSTALL the damn thing. After which, of course, I would have been stuck in contract with them for 12 months. Thankfully, God leant down and slappeth me with his fist, which totally caught me by no surprise. He then proceeded to tell me how awful AT&T was and yaddy, yaddy, yadda.

Long, and essentially pointless, story short, I ended up going with (God forbid me) TimeWarner Cable for my Internet.

However, with their BEST cable package I was able to save $80/month, as opposed to AT&T that would have sucked me dry. And in case you're wondering, yes I meant that on top of the $50 I'm paying right now for TimeWarner Cable's BEST Internet package, I would have been paying $130/month for Internet had I gone with AT&T. Granted, I'm getting ~18.25/mbps down, and ~1.74/mbps up with TimeWarner cable and would have been getting ~28/mbps down and ~3/mbps up, but +10 mbps down and +2 mbps up for an extra $80 a month? When they no-showed (that's right, no call to say they wouldn't come, they just didn't show up) FIVE TIMES? No thanks. I'm not going to waste my money on a company so big they can't even coordinate. Tell lanky-legs to size themselves down a bit, then maybe they'll get a couple customers back. Otherwise they'll soon earn the badge of the new, and always hated, "cable company" of fiber-optic ISPs.

// sent on October 12th, 2011 at 00:36:54...



The Death of a Genius

As many have already blogged, tweeted, posted, and talked about, Steve Jobs' died. This was a predictable tragedy, but a tragedy nonetheless. Co-founder and CEO of Apple Inc, co-founder of Pixar Animation Studios (responsible for incorporation), and innovative genius, Steve Jobs was quite an inspiration. Aspiring about becoming a business owner and making a name for myself in the web development world, I truly envied his success.

One quote that I continue to hold tight to is this,

The only way to do great work is to love what you do. If you haven’t found it yet, keep looking. Don’t settle. As with all matters of the heart, you’ll know when you find it.

// sent on October 10th, 2011 at 09:10:51...



Adventures in Model-View-Controller structure in PHP

As a want-to-be framework developer for PHP, I've spent much of my time researching frameworks, how they're developed, and attempted to find the best framework structure for a powerful, fast, and modular content management system. The result thus far has been the MVC design. It does a very good job of separating the business logic from the presentation code. MVC stands for "Model, View, Controller," the framework's comprised elements.

The Model is in charge of storing and retrieving data, whether that be from a database, external source, ffdb, or other resource. The point of a model is to be consistent across all connections and give the rest of the framework a central location for grabbing data.

The View is, of course, the visual aspect of the framework. It is strictly visual, and does not handle interaction. The Controller monitors and handles user input, and utilizes models and libraries to simulate the proper reaction.

Database -------                   -- { Controller } --
\ / | \
File System ------- [ Model ] -------- ( View ) ----- User
/
Ext Resources --

This framework structure is awarded its label of efficiency by preventing major coupling and fragmentation of presentation code, business logic, and data resources. The framework structure becomes a bit more complex as you delve deeper into it, but that is the overall structure.

Thanks to the copious amount of inspiration from Michael Munsie's MVC framework (http://mikemunsie.com/projects/munsieMVC/), which I had the pleasure of working with while at my previous contract job, I have begun the process of developing my own, similar framework. Though written from scratch, much of the framework resembles Mike Munsie's style of PHP MVC. I have to give him credit for a great PHP framework. His framework is lightweight and robust, so it's featureful but not a chore to manage.

No telling if or when I will have a release for this project, but I'll do my best to keep you all updated if I ever release this project.

// sent on September 29th, 2011 at 15:36:37...



Progression

It has been quite a long time since I have last posted on this blog, and quite a bit has changed. Granted, I may not have the time to divulge all the different adventures I have sailed through, but I will do my best.

A top the list is my very easily predicted engagement to the woman I continually, mistakenly label my "wife," my fiancé Megan Davis; following the exciting, planned first step into parenthood and our future together. In December, our son will be born and the expansion of our family will have begun. A long with our son, we currently have two dogs: Juliet and Molly. Molly, being the youngest, is still a bit of a handful. Thankfully she's taking after Juliet in a mostly positive way... But there are definitely times were Molly can sometimes influence Juliet negatively. In either case, we're happy to have the company of our two dogs, and excited to welcome in our son in December.

As for my career, it too is progressing quite nicely. After a three-four month contract developing back-end PHP web services and MVC-based applications in Irving, I have moved towards a bit more of a central location. The atmosphere is a bit more professional, and that's what I enjoy. This new job is for front-end development (I really can't choose between the two: front-end, or PHP back-end) and also pays a bit more. They've put me on one project as of right now, but it's a bit slow to get rolling so we'll have to see how I'll do a bit later on.

With the new job, Megan and I will be able to enjoy a bit more of a cushion on the financial side of our lives while we explore a life as parents. We're overjoyed to have such a blessed life, and I will thoroughly enjoy my future as a husband, father, and new front-end developer. Hah!

// sent on September 29th, 2011 at 10:36:44...



Updates and Random Babbles

After two months, Megan is about to experience her final weekend at, and move on to graduate from, Pathway's (http://www.createagreatlife.org/)! I'm incredibly proud of how far she's come these past three months, and I'm more than luck to call her woman. She'll be graduating this coming Sunday (June 4th), and soon after we'll have the benefit of celebrating her birthday. Next week, we'll be enjoying our time in our new apartment. For those of you who don't have the blessing of already knowing, Megan is currently close to 10 weeks pregnant with our child! We're both incredibly excited about this, and we're looking forward to enjoying the presence of a new soul in our lives come this December.

Aside from great news I've shared about my life, I have also recently updated the site, and a couple of projects of mine. First of all, I finally fixed that ugly little HTTP 500 bug that was plaguing my website! Now, you'll be welcomed warmly by the HTTP 404 error page that has been on the site for over a year but never viewed (haha).

On top of that, I'm also getting ready to work on and release another beta for the hW project a couple of you had the privilege of alpha and beta testing. In the same realm of development, Lemur is at a stage where it should see some major acceleration, as the underlying infrastructure's capabilities are tested, and the official specification is expanded upon and finalized. This should prove to be very beneficial to this project's future as a growing project, that could possibly see an official release.

Until next time, remember that action always outweighs intension. And, happiness is a conscious decision we can make every day, not a destination we reach. We all deserve it, and we're the only ones that keep ourselves from having it.

Cheers!

// sent on May 31st, 2011 at 04:06:28...



Another Amazing Weekend

This past weekend has been spectacular. It has been both inspiring, and joyful, as well as quite insightful. For the first time in quite some time I enjoyed a weekend attending Pathway's (http://www.createagreatlife.org/) as a refresher. It's been close to a year since I've attended and my refresh was quite needed. I thoroughly enjoyed my weekend and Megan was there to keep me company and on-contract, while she attended her Partners 1. She has given me more medicine then anyone else I have ever seen go through Pathway's. I have been so blessed to be able to spend so much time with her this past few months and our relationship is soaring at this point. And Megan won't stop reading what I'm typing O_O
....FAIL. She's trying to post the article before I'm finished with it! XD

Edit
And...She was successful... :P

Back to the original topic. This week has been great and something very special to me is happening right now... A test of our commitment! Currently, because of her situation Megan is living with me right now. This is huge and, before everyone starts bashing, I think this is the perfect time to start testing this portion of our relationship. Living with someone and seeing them on a daily basis and interacting with them and living their daily habits is much larger then the every-other-day type of relationship most people have with their significant other. I truly believe we're at a time in our relationship where this is yadddy yaddy yaddy (something somewhat significant...kind of)....

(That's Megan's attempt at summarizing the rest of this article... Thanks Megan! :D )

// sent on April 5th, 2011 at 13:44:12...



Functionality, At Last!

After over two years in hibernation, functionality on this website has finally poked its furry head out into the light once again.

Alright, so definitely wasn't my greatest attempt at personification, but I guess it worked.

Just knowing this website is functional once again brings me some peace of mind. It is quite exciting to be back to coding and expanding on a website. The important thing I learned in this is to take it step by step. I think one of my major problems with projects is I want to jump to the end result. This either trips me up (because I work too quickly, miss steps, and/or write sloppy) or burns me out, because I work too hard in the beginning and can no longer reach the end result.

By taking this project step by step I literally went from nothing to a functioning website in less then 3 days! This is quite an accomplishment for me, and it's quite fulfilling knowing that I still actually have the ability to right something fully functional again! (LOL)

So now, with the help of HTML Shiv (to get the HTML5 working on other browsers), the site is now up and running.

Those of you who may be keeping tabs, here's an updated list for you all to look forward to!

Implement concept specifications (yay for secrets!) [continuous wip]
Add Edit and Delete functions
Implement user system
Remove hardcoded markup
- Rely completely on simple template system
Add support for embedded BBCode and HTML tags
Add support for multiple styles
Add pages and categories to blog software

I hope this excites you all as much as it does me. And, for those wondering, SAX will be restored soon enough!

-Cheers!

Every artist was first an amateur. -Ralph Waldo Emerson

// sent on March 26th, 2011 at 02:23:36...



Rounding the Corner Towards a Live Project

Today, this project is just around the corner from being developed into a fully functioning, live project ready for debut.

At the moment, all that's left is to bring this project towards a more completely template-dependent source. Currently, it's using a sort of hybrid of hardcoded yuckiness and templating. For the most part, though, this project is using mainly templates, which is quite awesome I must say. The ability to centralize the entire project into a template-based source was an awesome task to achieve. The hallmark of this project is to make all the elements centered around a modular, object, and template approach.

For the site right now, there's a few more things that need to be changed up a bit before this project goes completely live (like the nav). I'm hoping to get as much of the project functioning as possible.

For now, though, I'll leave you all with an overview of my todo list:

Implement concept specifications (yay for secrets!)
Update navigation with working links
Implement user system
Remove hardcoded markup
Add support for multiple styles
Add pages and categories to blog software

Be advised, this list is not in any particular order. For now, though, the main thing that will probably be of focus is Update navigation with working links so that I can get this site online!

Don’t ask what the world needs. Ask what makes you come alive, and go do it. Because what the world needs is people who have come alive. -Howard Thurman

// sent on March 24th, 2011 at 19:34:15...



0.0721490383148