CSS Sprites: Image Slicing’s Kiss of Death Back when video games were still fun (we’re talking about the 8-bit glory days here), graphics were a much simpler matter by necessity. Bitmapped 2-dimensional character data and background scenery was individually drawn, much like today’s resurgent pixel art. Hundreds and later thousands of small graphics called sprites were the building blocks for all things visual in a game. Article Continues Below As game complexity increased, techniques developed to manage the multitude of sprites while keeping game play flowing. And what does this have to do with the web? Everything old is new again, and though the rise of 3D games has made sprite maps obsolete, the concurrent rise of mobile devices with 2D gaming capabilities have brought them back into vogue. Specifically, we’re going to replace old-school image slicing and dicing (and the necessary JavaScript) with a CSS solution. How do CSS Sprites work? Let’s start with the master image itself. On to the HTML. Applying the CSS#applyingcss
Using the memcached telnet interface This is a short summary of everything important that helps to inspect a running memcached instance. You need to know that memcached requires you to connect to it via telnet. The following post describes the usage of this interface. How To Connect Use "ps -ef" to find out which IP and port was passed when memcached was started and use the same with telnet to connect to memcache. Example: telnet 10.0.0.2 11211 Supported Commands The supported commands (the official ones and some unofficial) are documented in the doc/protocol.txt document. Sadly the syntax description isn't really clear and a simple help command listing the existing commands would be much better. Traffic Statistics You can query the current traffic statistics using the command stats You will get a listing which serves the number of connections, bytes in/out and much more. Example Output: Memory Statistics You can query the current memory statistics using stats slabs Which Keys Are Used? stats items Never Set a Timeout > 30 Days!
Get To Know Linux: The /etc/init.d Directory If you use Linux you most likely have heard of the init.d directory. But what exactly does this directory do? It ultimately does one thing but it does that one thing for your entire system, so init.d is very important. The init.d directory contains a number of start/stop scripts for various services on your system. Everything from acpid to x11-common is controlled from this directory. Of course it's not exactly that simple. If you look at the /etc directory you will find directories that are in the form rc#.d (Where # is a number reflects a specific initialization level - from 0 to 6). Now if you are using a distribution like Fedora you might find this directory in /etc/rc.d/init.d. In order to control any of the scripts in init.d manually you have to have root (or sudo) access. /etc/init.d/command OPTION Where command is the actual command to run and OPTION can be one of the following: startstopreloadrestartforce-reload Most often you will use either start, stop, or restart.
Logo design tutorial When a company starts, the image is often one of the things that can impulse the acknowledgment of the business existence around their area of influence. A company’s image primary consists of the logo, the stationery, presentation cards, mail templates and even digital signatures. Once the company starts to gain reconnaissance, other elements are developed, such as the website, social networks and others. On this tutorial we will be focusing our attention on one of the main elements of any company’s image, the logo. 1. It’s not the same to plan a logo idea for a fast food company than a heavy machinery factory, you need to determine your company’s identity in order to create an image that plays along with the whole idea of your business. Color are also strong communicators, a blue logo for example will evocate water, relax, sky or serenity, while a black logo for example will communicate seriousness, some relation with machinery works, petroleum and elegance. 2. 3. 4.
Lessons From A Review Of JavaScript Code - Smashing Coding Advertisement Before we start, I’d like to pose a question: when was the last time you asked someone to review your code? Reviewing code is possibly the single best technique to improve the overall quality of your solutions, and if you’re not actively taking advantage of it, then you’re missing out on identifying bugs and hearing suggestions that could make your code better. None of us write 100% bug-free code all of the time, so don’t feel there’s a stigma attached to seeking help. Some of the most experienced developers in our industry, from framework authors to browser developers, regularly request reviews of their code from others; asking whether something could be tweaked should in no way be considered embarrassing. Reviews are a technique like any other and should be used where possible. Today we’ll look at where to get your code reviewed, how to structure your requests, and what reviewers look for. Introduction Where Can I Get My Code Reviewed? What Should Code Reviews Provide?
Massive Compilation of Designer Tools Web designers have a wealth of tools available to them, for doing everything from organizing their thoughts about a particular design to debugging the final design. But with so many tools out there, how do you ever determine which ones are really useful and which ones are just going to waste your time? We’ve compiled a massive list of some of the best and most useful tools out there for web designers. Purposely left off the list are common tools most designers are likely already using (like Dreamweaver or Panic’s Coda, Photoshop or GIMP, and similar common software programs that pretty much every designer already has in their toolkit). These are tools that will save you time, make you a more effective designer, simplify or speed up your design process, or otherwise make your life easier. Compilation of Offline Tools Most roundups of useful web design tools only focus on online tools. But there are a couple of very useful tools you can utilize to open up your options when it comes to design.
Dates in PHP and MySQL I see a lot of people on forums and on my training courses asking about the best way (or any way) to manage dates stored in a MySQL database and used in PHP. Three options follow, but first the problem. PHP uses unix timestamps for all its date functionality. MySQL has three date types for use in columns. So the problem is how to work with these two very different date formats – the PHP timestamp integer and the MySQL DATETIME string. One common solution is to store the dates in DATETIME fields and use PHPs date() and strtotime() functions to convert between PHP timestamps and MySQL DATETIMEs. So finally we come to the choice of which to use. However, some queries will be more complicated because your date is not in a date field (e.g. select all users who’s birthday is today) and you may lose out in the long run.
Another variation on the "time ago" PHP function, use MySQL's datetime field type - PHP Programming - Web Development I was recently looking at writing a function to format the comment post times in the ever trendy "time ago" style... such as; Matt posted 6 days 3 hours ago Naturally I first scoured the web for an appropriate existing PHP function, and I came across this one; (dead link). Quite useful and fairly complete, but there were a few things I wanted to change, so I've hacked it up and remixed it here to accept a MySQL datetime field type result and then format the output like mentioned above. If you're using sNews and want to use this for your comments, simply follow these 2 quick steps. Step 1) As always, BACK-UP your snews.php file and work off a copy. Step 2) Now find the function comment, and comment out the existing date format and add the highlighted code like below; while ($r = mysql_fetch_array($result)) { //$date = date($date_format, strtotime($r['time'])); $date = time_ago($r['time']); $commentNum = $offset + $ordinal;
php - Converting a unix time stamp to twitter/facebook style Online Skin Builder for DHTMLX Component Library How to use DHTMLX Skin Builder DHTMLX Skin Builder is a tool which helps you to define any color schema for the interface of your application based on DHTMLX components (both Professional and Standard editions). You can choose some preset color scheme from the available list or create your own. To view the result in full screen mode, use the button on top right corner of the preview frame. How to apply new skin to your application When you got a color scheme you like, click Download button to get a zip file with all necessary files (css and images). Generated style can be easily applied to your application if you use the components as dhtmlx.js/dhtmlx.css files (i.e. compiled library files, which are delivered with every dhtmlx component package starting from v.2.5 or can be created using libCompiler). To use a new color scheme you need to place archive content into the directory where you have dhtmlx.css file and imgs folder (Replace files if asked.
Underscore.js CSS Transitions: A Simple Way To Delight Your Visitors We all want our designs to be functional and usable. We want visitors to easily complete tasks and find what they want. We’d also like to delight them and make their experience enjoyable and memorable.CSS3 transitions are an easy way to begin creating that delightful experience. I’ve built a demo of a navigation bar with and without transitions applied. Mouse over the menu items to see the difference transitions can make. With every post about css3 something needs to be said about browser support. Without IE support you might think that transitions aren’t ready for prime time just yet, but this is one area where you can safely use css3 even if it won’t work across all browsers. In his book CSS3 For Web Designers, Dan Cederholm points out that we can divide the visual experience on websites into two categories: critical — branding, usability, accessibility, layoutnon-critical — interaction, visual rewards, feedback, movement How to Use CSS3 Transitions transition-property transition-duration
Howto: Linux Add User To Group How can I add a user to a group under Linux operating system using command line options? How to add an existing user into a group in Linux using command line options? You can use the useradd or usermod commands to add a user to a group. The useradd command creates a new user or update default new user information. Primary user group.Secondary or supplementary user group. All user account related information are stored in the following files: /etc/passwd – Contains one line for each user account. useradd Example – Add a new user to secondary group You need to the useradd command to add new users to existing group (or create a new group and then add user). developers:x:1124: If you do not see any output then you need to add group developers using the groupadd command: # groupadd developers Verify that user vivek does not exists: # grep ^vivek /etc/passwd You should not see any outputs from above command. uid=1122(vivek) gid=1125(vivek) groups=1125(vivek),1124(developers) A note about security
Build seven good object-oriented habits in PHP Make your PHP applications better with object orientation Nathan GoodPublished on October 28, 2008 In the early days of PHP programming, PHP code was limited to being procedural in nature. Procedural code is characterized by the use of procedures for the building blocks of the application. Procedures offer a certain level of reuse by allowing procedures to be called by other procedures. However, without object-oriented language constructs, a programmer can still introduce OO characteristics into PHP code. While purely procedural designs without much modularity run just fine, the advantages of OO design show up in the maintenance. Modularity— one of the key characteristics of good OO design — helps with this maintenance. While there are more than seven habits to building OO software overall, the seven habits here are what you need to make your code fit basic OO design criteria. The seven good PHP OO habits are: Be modest Bad habit: Expose public fields Listing 1. Listing 2. Listing 3.