background preloader

Web Development

Facebook Twitter

Sass - Syntactically Awesome Stylesheets. Developing Backbone.js Applications - By Addy Osmani (@addyosmani) Available free for open-source reading below or for purchase via the O'Reilly store. Pull requests and comments always welcome. Prelude Not so long ago, “data-rich web application” was an oxymoron. Today, these applications are everywhere and you need to know how to build them. Traditionally, web applications left the heavy-lifting of data to servers that pushed HTML to the browser in complete page loads.

The use of client-side JavaScript was limited to improving the user experience. Think of the Ajax shopping cart which doesn’t require a refresh on the page when adding an item to your basket. The rise of arbitrary code on the client-side which can talk to the server however it sees fit has meant an increase in client-side complexity. Thankfully, there are a growing number of JavaScript libraries that can help improve the structure and maintainability of your code, making it easier to build ambitious interfaces without a great deal of effort. Target Audience <! Intro.js | A better way for new feature introduction and step-by-step users guide. Writing efficient CSS selectors. 17 September, 2011 Efficient CSS is not a new topic, nor one that I really need to cover, but it’s something I’m really interested in and have been keeping an eye on more and more since working at Sky.

A lot of people forget, or simply don’t realise, that CSS can be both performant and non-performant. This can be easily forgiven however when you realise just how little you can, err, realise, non-performant CSS. These rules only really apply to high performance websites where speed is a feature, and 1000s of DOM elements can appear on any given page. But best practice is best practice, and it doesn’t matter whether you’re building the next Facebook, or a site for the local decorator, it’s always good to know… CSS selectors CSS selectors will not be new to most of us, the more basic selectors are type (e.g. div), ID (e.g.

More uncommon ones include basic pseudo-classes (e.g. ID, e.g. Quoted from Even Faster Websites by Steve Souders N.B. Combining selectors Now, we read these left-to-right. But. WebKit for Developers. For many of us developers, WebKit is a black box. We throw HTML, CSS, JS and a bunch of assets at it, and WebKit, somehow.. magically, gives us a webpage that looks and works well. But in fact, as my colleague Ilya Grigorik puts it… WebKit isn’t a black box. It’s a white box. And not just that, but an open, white box. So let’s take a moment to understand some things: What is WebKit? Now, especially with the news that Opera has moved to WebKit, we have a lot of WebKit browsers out there, but its pretty hard to know what they share and where they part ways.

Standard Web Browser Components Let’s lay out a few components of the modern day web browser: Parsing (HTML, XML, CSS, JavaScript)LayoutText and graphics renderingImage decodingGPU interactionNetwork accessHardware acceleration Which of those are shared in WebKit-based browsers? The others are handled by individual WebKit ports. The WebKit Ports As mentioned above, using CG is unique to the Mac port. . … though Safari for Windows is now dead. 20 WebGL sites that will blow your mind. Dat.GUI. Retro Style Platform Runner Game for mobile with EaselJS (Part 1) | indiegamr.

Editors Note: The tutorial is a little bit outdated now, but it still works. However if you would like to learn more on this topic and get a more detailed verison plus all the extras and resources, you should check out my ebook: From Zero to the Appstore – Blueprints for an HTML5 Game. Here I’m starting a series of 4 articles on how to create a small game with EaselJS that “can” run on your mobile device (unfortunately it won’t run on all mobile devices) – however I also plan on a future posting on how to use technologies like cocoonJS to create a WELL-PERFORMING native app from this. The FINAL result The result is going to look similar to this (but with better code!) To test this on your mobile device, point your mobile browser to: The result of Part 1&Part 2 Let’s get started with the basics – Setting up the Stage Ticker.setFPS(30); Ticker.addListener(tick); function tick(e) { stage.update(); } Great!

More basics – Adding something to the stage Great! Agenda. Documentation. HTTP/1.1: Method Definitions. Php - REST API - why use PUT DELETE POST GET. Henrycode • JavaScript: Clarifying the Keyword 'this' You’re not anonymous. I know your name, email, and company. Sumit Suman recently visited a site, did not sign up for anything, did not connect via social media, but got a personal email from the site the next day. Here’s how they did it. I’ve learned that there is a “website intelligence” network that tracks form submissions across their customer network. So, if a visitors fills out a form on Site A with their name and email, Site B knows their name and email too as soon as they land on the site. It all started 2 weeks ago when I got a promotional email (anonymized to avoid promotion) offering to discretely integrate with your existing web site to identify visitors to your website. I get B2B marketing emails all the time but what caught my eye was the inclusion of a report snapshot for 42Floors.com showing names, companies, and emails of site visitors and the information seemed plausible.

Note the last sentence: I was still skeptical. A real-world analogue would be this scenario: You drive to Home Depot and walk in. Farfetched? About Darren Nix. Olark | Live chat with your customers for sales and support. Mashape - Cloud API Hub.

CMS Content Management Systems

Web Sites with Embedded Command Lines: You got your Command Line in my Internet. Sticky Footer. How to Prevent Email Injection in Your PHP Mail Form Scripts. Code your PHP scripts to prevent this security vulnerability by Christopher Heng, thesitewizard.com Nowadays, many websites no longer post their webmasters' email addresses, preferring instead to put up a contact or feedback form. Without the plethora of email addresses to harvest from websites, spammers have turned to using such feedback form scripts to send spam instead.

If you are writing your own feedback form script, it is important that you write your script in such a way so as to prevent spammers from hijacking the script to spam others. How Does Email Form Hijacking Work? A PHP script that sends email, as mentioned in my PHP tutorial, typically calls on the mail() function to deliver the email. Mail( "yourname@example.com", "Feedback Form Results", $message, "From: $email" ); The code above sends the message to yourname@example.com, which is presumably the webmaster's address. How to Avoid Email Injection and Mail Form Script Hijacking Conclusion Do you find this article useful? Mobile Apps: HTML5 vs Native. Last week, Facebook transitioned its iOS app to be fully native.

This has triggered another round of debate over the merits of native apps vs. HTML5. I am motivated to contribute my thoughts on this issue. Public discourse on this topic tends toward the extremes. I participated in a recent discussion which started with someone worrying that his company will have to support Microsoft Surface in addition to Android and iPad, and ended with someone saying, "Or you could use HTML5 and get all three platforms for free. " Marc Andreessen, an influential bishop of the web, has said: "The application model of the future is the web application model.

It seems like most people look at this situation and see black or white. The question The main question in play here is: How thick should clients be? Let me define my terms: I define the Client as the thing which is used by exactly one user, which interacts directly with that user, and which is probably physically close to that person. The Extremes Bets. How to Use the Sticky Footer HTML & CSS Code. Be sure to read the Known Issues at the bottom of this page. It will help prevent a lot of mistakes that can take hours to debug. Introduction There are many sticky footer methods to be found in Google.

I've tried many of them and they usually fail in some regards. The problem it seems is that some of these methods are old and may have worked in older browsers but they don't in newer browser releases. Ryan Fait's solution is well known, and it works, but it requires an extra <div> with no content in it to provide an extra "push". The Sticky Footer solution presented here is based upon the information found in the Exploring Footers article from A List Apart as well as expands upon the work of Cameron Adams and this piece at lwis.net. In an early version it applied a clear fix hack to keep the footer in place in Google Chrome and other browsers where the footer would float up when you resized the window.

The HTML Code Below is the basic structure of the HTML code. The CSS Code Known Issues. A CSS Sticky Footer. A CSS Sticky Footer that just works We've all tried to use a CSS Sticky Footer one time or another, but they never seem to come out right, do they? Well, the days of a hard to understand CSS Sticky Footer are thankfully over. With just a few simple CSS classes with minimal extra HTML markup, I've fashioned a CSS Sticky Footer that even beginners can get a handle on.

It's been tested in IE 5 and up, Chrome, Firefox, Safari and Opera. Usage of the CSS Sticky Footer Great! This is exactly what I'm looking for! Absolutely. View the CSS or learn about using it NEW: HTML5 Sticky Footer. Introduction to the HTML5 Web Workers: the JavaScript multithreading approach - David Rousset.

An HTML5 application is obviously written using JavaScript. But compared to other kind of development environments (like native one), JavaScript historically suffers from an important limitation: all its execution process remains inside a unique thread. This could be pretty annoying with today multi-cores processors like the i5/i7 containing up to 8 logical CPUs and even with the latest ARM mobile processors being dual or even quad-cores. Hopefully, we’re going to see that HTML5 offers to the web a way to better handle these new marvelous processors to help you embrace a new generation of web applications.

Pour ceux qui pratiquent la langue de Molière, vous trouverez une version française ici : Introduction aux Web Workers d’HTML5 : le multithreading version JavaScript Before the workers… This JavaScript limitation implies that a long running processing will freeze the main window. Hopefully, up to now, those problems were rarely occuring for 2 main reasons: My 1st Web Worker <! <! How To Set Up Your Own Online Store. Roundabout for jQuery by Fred LeBlanc. It’s ready-to-go straight out of the box, but if you want to get crazy, Roundabout is highly-customizable with an extensive API that allows for some pretty amazing results. Roundabout requires jQuery (at least version 1.2, successfully tested through version 1.7.2).

It works in all major modern browsers and even some of the older, not-so-modern ones. It’s open source and released under the BSD license, meaning that it’s free to use in your personal or commercial projects. See Roundabout In Action Add-Ons Roundabout is equipped to play nicely with a couple of other plugins if they’re made available. Roundabout Shapes by Fred LeBlanc Roundabout can move in more ways than just a turntable. But That’s Not All! The list above is only a list of the plugins that have support baked in, but Roundabout will play nicely with many other plugins. Learn Support New in V2 The code is also a lot cleaner and better commented, which will hopefully allow you to get in there and tweak if you want to. to this: Usage. ContentFlow. ContentFlow is a flexible CoverflowTM / ImageFlow like flow written in javascript, which can handle any kind of content. It supports all new and old major and not so major browsers. It's distributed under the MIT License.

With ContentFlow it is now possible to have any number of flows within one web-page. Each separately configurable, satisfying different visual needs. It's easy to implement and to extend. ContentFlow can handle different kinds of control, like keyboard and mouse, and can be used with and without a reflection. Changelog for version 1.0.2 (2010/02/19): * fixed IE bug on reflection generation Changelog for version 1.0.1 (2010/02/18): * fixed bug with addItem * fixed CSS 'type' error Thanks to Nicolas Rudas * added AJAX example Changelog for version 1.0.0 (2010/02/09): Beware: Because of a major restructuring, this release will break with older AddOns and possibly with user defined configurations. AddOns Changelog: Basic jQuery Form Validation Example (2mins) This tutorial will show you how to setup front-end form validation using jQuery in just a few minutes. I’ve kept this tutorial very basic with simple clear instructions so that anyone can implement some validation on their webpage forms.

There is a live demo and also a complete download package at the end of the post. View Demo Download Code Example: User Registration Form The Same Form With Validation This is what your form will look like when a user tries to submit an empty form. Related Posts: 2min Setup Validation Instructions Step 1 – Include the latest version of the jQuery Library. Or use the hotlink welcome file: //hosted by Microsoft Ajax CDN<script src=" Step 2 – Download the jQuery Validation Plugin.

//hosted by Google API<script src=" (function($,W,D){var JQUERY4U ={}; })(jQuery, window, document); <h2>User Registration</h2> PHP: Verify And Sanitize Email Address. Q. How do I verify input data such as email address under PHP programming language? A. You need to use PHP Filters designed for safely dealing with input parameters. It can validate and filter data coming from some insecure source, such as user input via filter extension.

=> regex => url => email => strings => magic_quotes => regular data types such as int, float etc Validate email address Here is a sample code: filter_var() will filter a variable with a specified filter. $out=filter_var($email, FILTER_SANITIZE_EMAIL); Here is another sample: Further readings: How to Validate a Form Using PHP Part 1: Complete with Error Messages! Having a site visitor fill out a form is the primary way to gather information. Forms are the main line of communication with anyone that visits your site, so taking the time to make sure users fill them out correctly is key. Using PHP, we are able to ensure that all fields are properly filled out before submission, with required adjustments being called to attention through the use of error messages. The CSS & HTML Groundwork Let’s start off by opening up a fresh php document and putting a form within it. I have created errorpart1.php With the following styles applied to the form: Next we have to construct our form, I have chosen to create a three field form, including one hidden field entitled “submitted”, which serves to check if the form has been completed.

Now that we’ve laid out and styled up our page, it’s time to come in with some PHP. The PHP and Validation Next up we have to check each mandatory field for a value of some kind. $errormsg = ""; //Initialize errors And that’s it. Attack. One list, many options - Using CSS and a simple list to create radically different list options. BitTorrent Turns Web Browsers Into a File-Sharing Hub. HTML5 Presentation. RGB-to-Hex Color Converter. CSS Angles: Just the Edge Your Web Page Needs! Quick Tip – Resizing Images Based On Browser Window Size. Mousetrap - Keyboard shortcuts in Javascript.

3.8.2 HTLM5 Canvas KineticJS Rotation Animation Tutorial. Professor Cloud. 8 Useful Tips to Add a HTML5 Canvas Animation in Websites. So, You Dropped Out of College. Html - How to add some non-standard font to a website. How to Install a Wiki on your Website. Download.