Simple Beginner Guide for Using PHP cURL
Apr 10, 2015Programming
cURL has a lot of configuration options and much more power than file_get_contents, but it can be daunting to learn. This guide is designed to teach you cURL from its most basic steps, and build onto it slowly so that you can understand it easily.
Continue Reading ›
Country Code To Name Conversion PHP Function
Nov 3, 2014Programming
Here is a compact PHP function that you can use to convert two-digit country codes to their corresponding full names in English:
Continue Reading ›
PHP T_STRING Line 1 Newline Error When Uploading From Windows to Apache/Nginx
Oct 30, 2014Programming
If your PHP source files only use a carriage return (\r) and not a carriage return line feed (\r\n) or line feed (\n), then you may run into this error when uploading to an Apache or Nginx server:
Continue Reading ›
Run Something When Chrome First Starts - Chrome Extension Development
Oct 24, 2014Programming
Since version 23 of Chrome, you can listen for the event onStartup, which will fire each time Chrome is started. If the user closes Chrome and quickly reopens it (before the chrome process has ended), it will still fire off this event when the Chrome window opens up.
Continue Reading ›
How To Get The Window Count - Chrome Extension Development
Oct 23, 2014Programming
Use this code to get the number of open Chrome windows. It must be used inside the extension scope, such as on a background or event page. It cannot be used in a content script (though you can pass this information via a message if needed).
Continue Reading ›
Simple & Safe JavaScript Minifier
Sep 22, 2014ProgrammingComments (1)
This JavaScript minifier removes all line breaks, tabs, comments, trailing semi-colons, and any unnecessary spaces. It performs no sorting or compressing, so it won't have any impact on how your JavaScript executes.
Continue Reading ›
PHP Include XML File Not Working [Solution]
Aug 16, 2014Programming
If you've ever tried to include an XML file using the PHP include statement, you may have ran into a compile error or it may simply not work. This is very likely because the XML file starts with the characters <? and the include statement is trying to parse it as PHP.
Continue Reading ›
M2E Pro Adds Break <br /> And Paragraph <p> Tags To Description In Magento CE
Aug 4, 2014Programming
If you use Magento CE (Community Edition) M2E Pro extension to list and sync items with eBay, and your product descriptions contain HTML, you may find that it automatically adds in extra break and paragraph tags (<br /> and <p>). This can be very frustrating if you've already taken care of the breaks and paragraphs in HTML. Thankfully you can fix this functionality with a quick edit to an M2E Pro source PHP file.
Continue Reading ›
Create Hash From A String Online
Jun 20, 2014Programming
Enter a string to generate the hash of. This will return the MD5, SHA1, SHA256, and SHA512 hashes.
Continue Reading ›
How to Put Magento CE Store in Maintenance Mode Based on IP
May 19, 2014Programming
Magento Community Edition does not have a convenient maintenance mode and the "maintenance.flag" file method is too heavy-handed. You may want to put the store into maintenance mode but still give yourself access. Here is a quick and dirty way to do it using PHP.
Continue Reading ›
JavaScript Canvas - Using Object Pool To Reduce Game Garbage Collection and Stuttering
Feb 18, 2014Programming
If your JavaScript Canvas game suffers from intermittent stuttering, it may be the result of garbage collection. A lot of games utilize particles, bullets, and other objects that are created rapidly and then discarded. Storing these unused items in a pool, and then drawing from that pool the next time you need one, is one way to reduce stuttering and improve performance.
Continue Reading ›
JavaScript - How To Get Mouse Scroll Wheel Events in Both Firefox and Chrome
Feb 18, 2014ProgrammingComments (2)
Firefox and Chrome use two different JavaScript events for the mouse wheel, and the delta attribute is under a different name in each. Fortunately, there is a simple work-around that will be sufficient in most situations:
Continue Reading ›
JavaScript Canvas - Getting Mouse Position When Page is Scrolled
Feb 16, 2014ProgrammingComments (5)
If the user has scrolled the page that your canvas game is on, or used the browser zoom feature, it can mess up the accurate calculation of the mouse position. An easy solution is to use the getBoundingClientRect method of the canvas object. This returns a rectangle object that gives you the current offset of the canvas relative to the page.
Continue Reading ›
Complete Roguelike Flash Game In 1649 Bytes
Jan 13, 2014Programming
I was inspired by this blog post by Emanuele Feronato about making a sub-2KB Roguelike Flash game. Using his game as inspiration, I decided to try it out. I used BitmapData to display the game objects instead of TextField and ended up getting it down to 1649 bytes. The game rules are very similar, though it is programmed from scratch. The result is embedded below:
Continue Reading ›
NewerPage 2Older