Web Development

PHP unexplainable errors on line 1

Posted in Programing, Web Development on September 25th, 2014 by Jarred – Comments Off on PHP unexplainable errors on line 1

Just throwing this out there for anyone who might be experiencing some crazy PHP errors that don’t make any sense. I have been away from PHP for a while but started working on little project that requires a php back-end. But, right from the get-go I was getting some really simple errors that I knew could not be the issue (such as “unexpected end of file” or simple syntax errors for unexpected strings etc.) At first I thought it might be that I was just a little rusty on the php syntax, but could not figure out what was going on and could not get anything to work. The files I was working with were extremely small and it was obvious the syntax was correct, but the weird errors were persisting. Thing was they were were all occurring at line 1, which was puzzling at the time, but I didn’t give it much thought (which should have been a huge red flag to me). So, it turns out my editor of choice (Notepad++) was only inserting a CR (carriage return) and not the full CRLF (carriage return line feed) not quite sure why this behavior was happening (or why PHP engine could not figue it out), but as soon as I replaced the CRs with CRLFs everything started working as expected. I did not investigate this all the way, but I am assuming this probably has something to do with how my host has PHP configured or something simple like that, but for the uninitiated this can really perplexing (and incredibly frustrating). So, the take away here is if you are having some unexplainable PHP errors that are all occurring on line one, maybe check out what you are using for your EOL (end of line) characters and see if that is the issue.

Transit – CSS transformations plug-in for jQuery

Posted in Web Development on September 15th, 2014 by Jarred – Comments Off on Transit – CSS transformations plug-in for jQuery

I came across a little jquery plug-in that I found quite nifty and thought it deserved a shout out. The plug-in is called Transit and can be found here: http://ricostacruz.com/jquery.transit/ The plug-in not only makes css transformations a breeze the end animations produced are incredibly smooth. It is very simple and straightforward to use. Anybody already familiar with jquery .animate() will be able to pick it up with little or no effort. As of version 0.9.12 the minified file is only about 8kb. I built a little game using the plug-in (game to be released publicly in a post to come) and was very pleased with the outcome. I really couldn’t be more happy with the the whole thing with the and figured I would little post it here so A: I can remember it personally and also B: give the project a bit of love so hopefully development will continue.

Jquery click not binding to checkbox (or any other element)

Posted in Geekdom, Programing, Web Development on January 24th, 2014 by Jarred – Comments Off on Jquery click not binding to checkbox (or any other element)

I am just writing this down for the sake of my own personal sanity. I just spent way too much time trying to trouble shoot why I could not bind a click event to a checkboxes in jquery. This post here gave me a clue what I was doing wrong. If by chance you are having a similar issue make sure that the element you are trying to bind to is already created and part of the DOM or it will not work and you will be left befuddled why exactly nothing is happening (at least I was).

CSS3 Gradient Generator Tool

Posted in Geekdom, Web Development on November 6th, 2013 by Jarred – Comments Off on CSS3 Gradient Generator Tool

For my next project I am working on achieving a web 2.0 look/feel and wanted to include shadows and gradients. I came across a css gradient generator tool that I absolutely love and made my life easier so I thought I would post it here really quick. You can find it here: http://www.colorzilla.com/gradient-editor/

Reflections upon my last project

Posted in Entrepreneurship, Programing, Web Development on August 24th, 2013 by Jarred – Comments Off on Reflections upon my last project

So, I have come to the realization that I may not have the best ability to pick projects that end up being significant sources of income. In light of this realization, a few months ago I decided it was time to try and to a few “speed” projects rather than invest monumental amounts of time on a single project that more than likely will have lackluster resulted. While in theory this idea seems to make sense, in practice I am afraid once again I fell short of the mark.

 

While trying to find some decent rates for a personal HSA (health savings accounts) accounts, I found that useful online resources were few and far between. I decided that this might be a perfect niche opportunity to not only track and compare the interest rates offered by different custodians (something I was doing anyways), but also hopefully create a quick little site that others would find useful. I imagined the adsense keywords related to a health savings account site would be higher paying and the structure/layout of the site could be extremely simple and easy. All in all I judged it would be a lightning quick sprint of a project that would have some income generating potential.

 

I judged wrong (at least on the “lightning quick sprint of a project “ part). If you like, take a look at it here: While I am extremely happy with the final product, I logged about 66 hours so far getting it up and running. I started out using a Google doc spreadsheet as the database as I believed this would be fairly easy to maintain. Realizing that the maintenance of such a site would be significant, as an afterthought I decided to try and integrate with Amazon Mechanical Turk to try and crowdsource a lot of the nitty gritty upkeep. But I failed to account for how long this integration would take, and then how much I actually would have to pay to get the quality upkeep I was looking for. So, in the end, after taking all the time to integrate, I decided that the original spreadsheet idea was a much better idea and switched back (of course I deleted most of the previous versions so I had to rewrite much of it from scratch again). This took much longer than expected. In short, some of the takeaway lessons from the project are: I need to do a better job planning out my projects from the get go, and also I need to keep all of the past revisions (even if I don’t think I am going to end up re-using them).

 

So despite being disappointed by the much longer than expected time frame, I think the site turned out looking pretty good and could be quite useful for anyone looking to compare rates on HSA account. If by any chance you are looking for for a HSA account check the site out here: HSA Rates  As of yet there is next to no traffic to the site and of course this means as of yet it has not produced any real income. I am hopeful however that as the site gets indexed and gets some backlinks it will help improve income rate and bring me closer to my goal.

Remove an Element with a Relative Position from the Normal Flow of a Web Page

Posted in Programing, Web Development on March 8th, 2013 by Jarred – Comments Off on Remove an Element with a Relative Position from the Normal Flow of a Web Page

Here is a nifty little trick I found on a post from StackOverflow. I usually prefer to “relatively” position elements in my pages so that I can have a more fluid designs. However relatively positioned elements are not taken out of the normal flow of the document and so often I am left with a big ugly blank space where they would normally be found. This can lead to all sorts of issues especially when you try and relatively position every element thereafter to cover the ever growing blank spaces. Here is a novel solution that will create a 0 height 0 width pseudo-relative element to wrap around a absolutely positioned element to give you a relative reference point that will not leave that dreaded big blank space.

<div style=”position: relative; width: 0; height: 0″>
<div style=”position: absolute; left: 100px; top: 100px”>
Hi there, I’m 100px offset from where I ought to be, from the top and left.
</div>
</div>

Taken From: http://stackoverflow.com/questions/6040005/relatively-position-an-element-without-it-taking-up-space-in-document-flow

Getting the back button to work with Backbone and jquery mobile

Posted in Programing, Web Development on January 3rd, 2013 by Jarred – Comments Off on Getting the back button to work with Backbone and jquery mobile

I was getting some strange errors in my app when trying to get the back button to work with the pushState history provided by Backbone.js. I was getting this error: Uncaught TypeError: Cannot call method ‘replace’ of undefined jquery.mobile-1.2.0.min.js:2 I suspected it was a conflict between the “routing” systems provided by jquery mobile and the backbone frameworks. In my search to figure out how to make it work I came across this post here http://coenraets.org/blog/2012/03/using-backbone-js-with-jquery-mobile/ The solution presented in the article however did not work for my as apparently (unknown to me) I was using some of the features that were being disabled. To solve my issues I pared down what the article suggested I disable and then just inserted the code into script tags right after I loaded all the frameworks. I now have a functioning back button in my hybrid jquery mobile/backbone app.

$.mobile.hashListeningEnabled = false;
$.mobile.pushStateEnabled = false;

Google Chart Tools

Posted in Web Development on August 2nd, 2012 by Jarred – Comments Off on Google Chart Tools

So, I have been using the Highcharts JavaScript API to draw the income charts on this site. I spent a lot of time figuring them out and I really really liked how the high-charts looked on my site. However, the free version just did not offer very good ways to display really dense data sets. My experiment has been going on long enough that the charts were getting unreadable and cluttered and so I went searching for free alternative charting API that had scroll bars and could better handle dense data. I found out about Google Chart Tools and really liked them. They are the charts you can currently find on my site are the ones documented here. It did take me several hours to figure everything out but all in all I highly recommend them if you are looking for a free charting API and need to display dense data.

My first viral spike

Posted in Entrepreneurship, Web Development on April 30th, 2012 by Jarred – Comments Off on My first viral spike

I came home from a vacation and decided to check my google analytics account to see what kind of traffic I was getting to my sites. I was very surprised (and excited) to find that my visit count for the day was incredibly high for my html5gamer.net site. I had been getting 20-50 visitors a day and then boom there were hundreds of visits recorded for the day. I remember at one point checking the the number of active visitors on my site and seeing that there was currently 30 and thinking that there was some kind of problem with the code. But after a while and some double checking it looked legit, my site was actually receiving some significant traffic.

Of course in the moment I thought I had made it, that the site was talking off and soon I would be rolling in money with all the advertising profit I would make. Then reality set in and I started trying to figure out where all the traffic was coming from. It didn’t take long for me to figure out it was pretty much all from google plus. And it didn’t take long for the traffic to subside either. A day or two later the traffic peaked at 2282 visitors then declined as abruptly as it started.

Now I know that 2000 visits in a day is not really much to brag about as there are plenty of sites that regularly see much more traffic. But to me this was very exciting and a huge success. Unfortunately I don’t really know how to make it happen again. After traffic subsided I was quick to add social media buttons to my site hoping for a repeat, however to no avail nothing big came of it (unless you count $7.51 in adsense profit significant). While it is true that my daily visit count went up slightly to around 30-80 visitors in the weeks after the spike, nothing really significant came from it.

I guess that social media really can drive some significant traffic, however a lot of it seems like it is out of your hands. All you can do is create the best content possible and then just hope the web community deems your site worthy of sharing with their friends.

More free animated explosions on transparent backgrounds

Posted in Geekdom, Web Development on March 2nd, 2012 by Jarred – Comments Off on More free animated explosions on transparent backgrounds

I don’t really know why or how but for some reason the single post on my blog that has received the most traffic has been my post back in 7/11 titled “free Animated explosion on transparent background. This does seem a bit strange to me as it really is not all that relevant to the keywords I am trying to target with my blog. Nonetheless, I am currently working on another HTML5 game and have some additional animated explosion sprite sheets and am going to post there here as kind of an experiment to see what happens.  You can save them by right click – save image as.

explosion with transparent background

Free animated explosion

Free animated explosion small

Free animated explosion small

I did not draw these, I simply re-sized them and removed the background. They are saved in .png format and have a transparent background making them perfect for use as a sprite sheet in a game. You are free to use them in any way you see fit. I got the original files from lostgarden.com

If you are looking for some more free animated sprite sheets I highly recommend you take a look around all the things Lostgarden has to offer. There are a lot of free to use pixel art animations including several other explosions. They do not however have transparent backgrounds so you will have to edit them out yourself.