background preloader

Development

Facebook Twitter

Write your own PHP MVC Framework (Part 1) | anant garg. What is MVC? From Wikipedia– Model–View–Controller (MVC) is an architectural pattern used in software engineering. Successful use of the pattern isolates business logic from user interface considerations, resulting in an application where it is easier to modify either the visual appearance of the application or the underlying business rules without affecting the other.

In MVC, the model represents the information (the data) of the application; the view corresponds to elements of the user interface such as text, checkbox items, and so forth; and the controller manages the communication of data and the business rules used to manipulate the data to and from the model. In simpler words- 1. Model handles all our database logic. Why should I write my own framework? This tutorial is by no means a comprehensive/definitive solution to your framework needs. So why should you write your own framework? More importantly, you have complete control over your framework. Lets dive right in Coding Conventions. Demo | jQuery.popeye 2.1 | an inline lightbox alternative with slideshow.

X Note: To see the full potential of CSS3 styling (shadows, gradients, rounded corners, alpha transparency), please view this page in a modern webkit or mozilla browser (Firefox 3.5+, Safari 4, Opera 10.50, Chrome 4). Other browsers will degrade gracefully. Except for IE6, though, which I didn't bother to include. Feel free to come up with your own solution ;-) Example 1 The first popeye-box uses the standard options: it floats to the left and opens to the right, its navigation and caption show on mouseover.

By placing the navigation inside the stage area (where the image is displayed), we can get it to hover above the image. No need to read this, just dummy text ;-) Vivamus ut nisi id libero interdum pretium. View HTML code used in this example Example 2 The navigation stays fixed to the right of the image. There is no enlarge button, but a click on the image enlaregs and shrinks it nevertheless. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. View HTML code used in this example. Hacking with Google Search. Google is considered to be a powerful search engine that helps millions of users to find fast & easy useful webpages. Nevertheless Google Search can also be a handy tool in the hands of malicious users, spammers & hackers.

In this article we will describe few tricks that can be used in Google Search in order to easily find and access pages that normally should be protected. At the end of the article we will discuss how webmasters can protect their sites from such attacks. Important Notice: The purpose of this article is to inform webmasters about the risks they face and help them secure their websites. How to Access Member Only Areas Lots of forums allow access in some or all of their threads only to their members.

Nevertheless, in some cases the webmasters of those forums allow Google to index the secured pages in order to appear in the search results and increase their SE traffic. If the cache operator is not available try searching for the URL address. Inurl:/view.shtml. How to Really Build Backlinks and Dominate Google. Without a doubt, the most frequent post request I’ve had on this site is a post about link building. I rarely take requests, simply because people rarely know what they really want until you give it to them, but this time things are a little different.

First of all, I have been studying SEO day and night since I was 16 (almost 5 years ago) and I’ve ranked on the first page of Google for some of the most competitive keyphrases in the world. Therefore, I like to think I know quite a bit about the topic and can provide some insights in this space. For those of you who don’t know why links are important, let me just say that if you want to get traffic from the major search engines, they’re crucial.

Links from other sites to your site are basically a ‘vote’ that tell search engines you are trusted and you are a good resource for whatever your content is about. SEO is generally divided into two parts: on-site optimisation and off-site optimisation. 15 Ways to Build Links to Your Site Be Useful. Infographic_Programming_Rackspace_Final_Version.png (1190×12496) 37 Tested PHP, Perl, and JavaScript Regular Expressions. InShare22 A regular expression, also called regex or regexp for short, is simply a piece of code that matches a pattern. Mastering regular expressions can be a difficult chore, and if you don't need them all of the time, the syntax is tricky enough to make the task frustrating or slow as you will constantly need to use a reference sheet.

In order to save you time, I've compiled a list of PHP, Perl, and JavaScript regular expressions for common use cases that have been tested and are ready to go. This isn't a regular expression tutorial or even a reference; you can think of it more as a cheatsheet for when you just need the regex but don't want to put a lot of time into relearning regular expressions. If you're looking for regex tutorials or regex resources, you can find them at the end of the page as well as some additional regex resources. Perl and PHP Regular Expressions All Major Credit Cards Alpha-Numeric Characters Test for alpha-numeric characters with this regexp.

Alphabetic Characters. Ultimate List Of Web Design Checklists: Get Work Done! When building a website, there are so many things and aspects to keep in mind. It often happens that in that mess we forget about some basic things like favicon or maybe about dummy content removal from test site. It’s much easier to go trough all those things when you have all of them written down.

In this article you are going to find bunch of different checklists, questionnaires and tips covering almost everything for an upcoming website. You probably will need just one of these tools, so choose carefully. Read some tips and decide which tool fits the best for your project planning and development process. Client Checklists 1. This article will help you create a prospect qualification questionnaire that can be used via telephone or Internet or in face-to-face meetings. 2. Reading some of these questions and following some guidelines will also save you and your client plenty of headaches throughout the process and pave the way to a lasting and trusting relationship. 5. 6. 8. 9. 10. 3. 4. The Future of Paid Search - Google, Bing & Beyond. Paid search has cemented itself as a highly viable, cost effective marketing channel. In 2011, paid search spending is expected to reach $34 billion. Worldwide, paid search is a $34 billion industry. In this graphic, we’ll briefly explore paid search—it’s current state, where it’s going, and how the largest paid search venders (Google & Bing) have divvied up the market.

Data courtesy of efrontier.com and magnaglobal.com. Click on the image below to view an larger version of this infographic: View an enlarged version of this Infographic » Click here to download a .pdf version of this infographic. Want to display this infographic on your site? Simply copy and paste the code below into the html of your website to display the infographic presented above: Facts and Stats to Tweet: Geeks and Delegation: A Match Made in Hell. Last week, I was invited to join 3,000 delegates to what turned out to be the largest entrepreneurship conference in the world. The Global Entrepreneurship Congress 2012 took place in Liverpool, UK (a few words about Liverpool in a moment) and its speakers and panels were selected in order to inspire us into entrepreneurial action.

Upon arriving in Liverpool on the GEC Express Virgin train, chartered for the specific occasion (welcoming speech and random encounter with Sir Richard Branson), I didn’t know what to expect. One of the first things that I found out, to my surprise, was how geeky Liverpool is! It has more scientists than Cambridge and a booming game industry (it’s supposedly second in the UK). Sir Richard Branson was the main ”attraction” for the day and who could blame the the crowd? Q&A with Sir Richard Branson Delegation was the first skill I was forced to learn when I made the jump from a technical to a managerial position. Don’t drop the “ball”!

The End of Pagination. What do you do when you have a lot of things to display to the user, far more than can possibly fit on the screen? Paginate, naturally. There are plenty of other real world examples in this 2007 article, but I wouldn't bother. If you've seen one pagination scheme, you've seen them all. The state of art in pagination hasn't exactly changed much – or at all, really – in the last 5 years.

I can understand paginating when you have 10, 50, 100, maybe even a few hundred items. Once you have thousands of items, you don't have a pagination problem. But perhaps you don't know exactly what you're looking for: maybe you want a variety of viewpoints and resources, or to compare a number of similar items. Once we've chosen a suitable order and a subset of relevant items … do we really need pagination at all? It isn't just oddball disemvowelled companies, either. Pagination is also friction. I'm not necessarily proposing that all traditional pagination be replaced with endless pagination.

SQL date performance problems. Most obfuscations involve DATE types. The Oracle database is particularly vulnerable in this respect because it has only one DATE type that always includes a time component as well. It has become common practice to use the TRUNC function to remove the time component. In truth, it does not remove the time but instead sets it to midnight because the Oracle database has no pure DATE type. To disregard the time component for a search you can use the TRUNC function on both sides of the comparison—e.g., to search for yesterday’s sales: SELECT ... It is a perfectly valid and correct statement but it cannot properly make use of an index on SALE_DATE. “This book is definitively worth having in the company library.” — Joe Celko There is a rather simple solution for this problem: a function-based index. CREATE INDEX index_name ON table_name (TRUNC(sale_date)) But then you must always use TRUNC(date_column) in the where clause.

SELECT ... The alternative is to use an explicit range condition. MySQL Tip. The Best 100% Free Wireframe Tool for Mobile and Web Apps. Flash and HTML5 Tutorials for Designers and Developers! 100 Best JavaScript Resources. JavaScript is an extremely useful scripting language for enhancing user experience and usability. It is becoming more and more popular, as more developers begin to make cool techniques accessible. Here are 100 excellent JavaScript (and a few AJAX) techniques, plugins, and resources based on the major libraries of jQuery, Prototype, Scriptaculous, MooTools, and Dojo. JavaScript Techniques and Tutorials Coda Pop-Up Tutorial Build An Incredible Login Form with jQuery Create a Slick Tabbed Content Area using CSS & jQuery Create a Simple, Intelligent Accordion Effect Using Prototype and Scriptaculus Create a Simple, Powerful Product Highlighter with MooTools Creating a Dynamic Poll with jQuery and PHP Creating a “Filterable” Portfolio with jQuery Leopard Desktop with jQuery using jqDock Adding to Our Leopard Desktop with jQuery Use the jQuery UI to Control the Size of Your Text Animated Drop Down Menu with jQuery Animated Menus Using jQuery Fancy Box Easiest Tooltip and Image Preview Using jQuery.

Tools To Make Your Web Development More Efficient. John K. Taylor Are you a developer who is sick and tired of having to do everything manually? Does sifting through your code to hunt down tiny mistakes make you want to scream? Then perhaps some of these web development tools will come in handy for making your work more efficient. CSS Grid Builder This is a framework that was developed by Yahoo! That enables a web developer to create a CSS-based and web standards compliant page in minutes. Clean AJAX This tool has been designed to speed up AJAX development, which is just not possible when done manually. CSS Sprite Generator This tool has been designed to reduce the number of HTTP requests are needed for rendering images in web browsers.

Firebug This is an extension created by Mozilla Firefox that gives a developer a wide range of web development tools and features that they otherwise may not have had access to. CSSTidy If you are a developer who would love to have more time on their hands for your work, the above tools are perfect for you. The Joel Test: 12 Steps to Better Code.

By Joel Spolsky Wednesday, August 09, 2000 Have you ever heard of SEMA? It's a fairly esoteric system for measuring how good a software team is. No, wait! Don't follow that link! It will take you about six years just to understand that stuff. The neat thing about The Joel Test is that it's easy to get a quick yes or no to each question. A score of 12 is perfect, 11 is tolerable, but 10 or lower and you've got serious problems. Of course, these are not the only factors that determine success or failure: in particular, if you have a great software team working on a product that nobody wants, well, people aren't going to want it. 1. 2.

If the process takes any more than one step, it is prone to errors. For this very reason, the last company I worked at switched from WISE to InstallShield: we required that the installation process be able to run, from a script, automatically, overnight, using the NT scheduler, and WISE couldn't run from the scheduler overnight, so we threw it out. 3. 4. 5. Google Algorithm Changes 1998-2012 [Infographic] Build PDF files dynamically with PHP. Sometimes you need control over exactly how pages are rendered for printing. At times like those, HTML is not the best choice. PDF files give you complete control over how pages are rendered and how text, graphics, and images are rendered on the page. Sadly, APIs for building PDF files are not standard parts of the PHP toolkit. Now is the time to bring in a little help. When you search the web for PDF support for PHP, the first thing you are likely to find is the commercial PDFLib library and its open source version, PDFLib-Lite.

Another choice is the Free PDF library (FPDF), which is native PHP. To demonstrate building PDF files dynamically, you'll use scores from women's roller derby tournaments. Listing 1. <events><event name='Beast of the East 2011'><game score1='88' team1='Toronto Gore-Gore Rollergirls' team2='Montreal La Racaille' score2='11'/><game score1='58' team1='Toronto Death Track Dolls' team2='Montreal Les Contrabanditas' score2='49'/> ... Listing 2. getresults.php <? <? <? <? How to Create Amazing Backlinks. Hallmarks of a Great Developer - Test Guide. If you ask me, I'll tell you a great developer Plans before coding A great developer takes the time to plan an approach before designing or coding. A great developer knows that the time required to do so will be more than paid back by the time saved by getting it more right the first time. A great developer plans all scales of work, from envisioning multiple versions of a product to writing or modifying a small method.

Always knows why A great developer always knows exactly why they wrote a particular line of code, and why they wrote it the way they did. Writes situation-appropriate code Any developer can write code. Deviates where and when necessary A great developer not only knows the canonical implementation but understands it is the canonical implementation.

Knows when not to change code A great developer knows that changing code is sometimes worse than fixing it. Approaches debugging scientifically A great developer knows that debugging is a science not an art and approaches it as such. How to Prevent Image Bandwidth Theft With .htaccess.