background preloader

37 Tested PHP, Perl, and JavaScript Regular Expressions

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 Related:  Mix

Anatomy of a Web Design Client Share this infographic on your site! <a href=" src=" alt="Anatomy of a Web Design Client" width="500" border="0" /></a><br />From: <a href=" Web Design Schools</a> Embed this infographic on your site! <a href=" src=" alt="Anatomy of a Web Design Client" width="500" border="0" /></a><br />From: <a href=" Anatomy of a Web Design Client We've all dealt with the typical web design client. Every business needs a website if they want to remain relevant which is why, in today's Internet drive world, the skill of web design and development is highly coveted. Here's how we perceive the world of web design clients: I Love This!

Desenvolvimento de projetos (/dev/Kico) A questão dos micro serviços ainda me acompanha. Desde a publicação do meu último post sobre o assunto venho recebendo feedback de diversas pessoas além de ter entrado em contato com tantas outras. Com a mente um pouco mais clara (ao menos espero) chegou a hora de expor minhas conclusões correntes sobre o assunto. A grande questão: é SOA? A conclusão que cheguei é quase óbvia: sim e com poucas novidades. O modelo de referência do OASIS é um documento bastante árido mas que lido com atenção nos fornece um sólido conceitual para entender, de fato, o que é SOA. O que é SOA? Citando o modelo de referência do OASIS, SOA seria (…) um paradigma que visa organizar e usar funcionalidades (capabilities) distribuídas que podem pertencer a distintos donos (ownership domains). Há um conceitual muito importante (e interessante) neste documento que é importante divulgar aqui. E o que é um serviço dentro deste conceitual? Estas informações são fundamentais para que o serviço possa ser descoberto.

PHP snippets to interact with Twitter Get number of Twitter followers Have you seen my blog sidebar? I display the number of followers I have in full text. Once you have the function, you can call it as shown below: $nb = get_followers('phpsnippets'); echo "PHP Snippets already have ". » Credit: Get latest Twitter status Using PHP and cURL, it is pretty easy to get the status of a specific user. The function is extremely easy to use: echo get_status('catswhocode'); » Link to update status, without encoding problems Many websites and blogs show you how to create a link to Twitter that will update your status. <a href=" So, where’s the change? A working example can be seen on my company website: Get number of retweets for a specific page Most bloggers are using the Tweetmeme widget to display the number of retweets of their posts. Testing friendship between two users

Automatic Face Detection in Photos with PHP I have always wondered how to detect faces automatically with php script. I have seen in many photo sharing and social network sites automatically detect a face and tag a name after being uploaded. In this article, i will explain how possible this task can be achieved with simplicity with OpenCV and PHP Facedetect extension. Goal To auto detect faces in a photo and draw pink box around the faces with a php script running a linux centos server. Requirements - Linux server running Centos with SSH access - PHP/Apache - GD Library - OpenCV [Download] - PHP Facedetect extension [Download] PHP facedetect extension is very simple. Installation We install opencv and then we compile the php facedetect extension with php. How to Install OpenCV If you are running centos then one single line will install opencv. yum install opencv OpenCV may also need the following depencies to work properly and you will need to install them as well. For more installation instructions on linux see here How to test run OpenCV

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.

CSS Techniques I Wish I Knew When I Started Designing Websites Dec 18 2009 By Tim Wright and TJ Kelly CSS is the best thing to happen to the web since Tim Berners-Lee. It’s simple, powerful, and easy to use. But even with all its simplicity, it hides some important capabilities. All designers at some point in their career go through the process of encountering a weird display issue, searching for a resolution, and discovering a trick, technique, or hack could have saved them hours of frustration—if they had only known when they started. We’ve put together a list of the most frustrating and time-consuming CSS headaches and, more importantly, their solutions (along with examples and further resources). Resets & Browser Inconsistencies Not all browsers are created equal. The early stages of resets, designers dealt with differing margin and padding values, using a global reset: inputbuttonhr These elements were excluded because their cross-browser differences are so vast that you would have to completely unstyle them to create a "bulletproof" element. <!

45 Free Online Computer Science Courses Missed lectures or hate teachers? Or want to study computer science courses without going to university? … You can study anytime anywhere because there are number of free online computer science courses available on internet that are very interactive. Here is the list of 45 free online computer science courses that are designed by teaching experts from best universities of the world (almost the whole graduation!). 1. Complete set of course materials. 2. This course is the natural successor to Programming Methodology and covers such advanced programming topics as recursion, algorithmic analysis, and data abstraction using the C++ programming language, which is similar to both C and Java. 3. Advanced memory management features of C and C++; the differences between imperative and object-oriented paradigms. 4. The purpose of this course is to introduce you to basics of modeling, design, planning, and control of robot systems. 5. 6. 7. 8. 9. 10. Continuation of Convex Optimization I. 11. 12.

Object Oriented PHP Tutorial for Beginners Preamble The hardest thing to learn (and teach btw,) in object oriented PHP is the basics. But once you understand them, the rest will come much, much easier. But don't be discouraged! … Or so I've been told. About This Tutorial This tutorial is designed to teach total beginners object oriented PHP. This is not a long-winded theoretical blathering that you see all too often; instead, we actually start writing OO code very quickly. So before you begin, get out your favorite PHP code editor and be ready to write and run some object oriented PHP code. PS: scroll to the bottom of the page for the supporting videos. Thanks for reading,Stefan Mischook Introduction With the release of php5 in 2004, php programmers finally had the power to code with the 'big boys'. In this tutorial, you will be guided (step-by-step) through the process of building and working with objects using php's built-in OOP capabilities. OOP Videos

To the Core of the Script To allow easier integration with other scripts and make things more modular the core script is an object with very simple interface. This is the class definition and the constructor of the object. OK it's not perfectly modular but a date isn't much of a problem. It is invoked like: $date = gmdate("'Y-m-d'"); $db = db_connect(); $user = new User($db); Now to clear the code purpose, we check if the user is logged in. Logging in Users To allow users to login you should build a web form, after validation of the form you can check if the user credentials are right with $user->_checkLogin('username', 'password', remember). function _checkLogin($username, $password, $remember) { $username = $this->db->quote($username); $password = $this->db->quote(md5($password)); $sql = "SELECT * FROM member WHERE " . The function definition should be placed inside the User class definition as all code that follows. The WHERE statement is optimized (the order of checks) because username is defined as UNIQUE.

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. A large percentage of my income to affiliate sites is from traffic via Google, and the difference between ranking 2nd and ranking 1st can literally be thousands of dollars extra on my bottom line. SEO is generally divided into two parts: on-site optimisation and off-site optimisation. Be Useful

Send Text Messages with PHP Kids these days, I tell ya. All they care about is the technology. The video games. The bottled water. Oh, and the texting, always the texting. omg did you hear? no wut omg i can't believe you didn't hear lol tell me! jenny and mark were holding hands omfg does john no? ok i made it up, ur so lame Riveting. The Methodology Unbeknownst to me, sending text messages can be as easy as sendmail, because you can send your text to an email address and it will be delivered. Phone companies have internal lookups for phone carriers but developers like you and I don't get access to them, so knowing the carrier is a must. The PHP PHP's provided method for sending emails is the mail function. bool mail ( string $to , string $subject , string $message [, string $additional_headers [, string $additional_parameters ]] ) Using the mail function and the text message email format, sending a text message is as easy as: mail("5558675309@txt.att.net", "", "Your packaged has arrived!" Who knew it was that easy?

6 Steps to Becoming a Software Developer Deciding to become a software developer is a great initial step, congrats! The job opportunities are growing quickly and in just about every industry that you can imagine. The best part is that you do not necessarily have to go to a four year university to become a great software developer to lock down one of these jobs. The web has all the resources you'll need to interact, learn, get support and finally find a job as a software developer. Let's go through some of them! 0. Codecademy - JavaScript coursesCode School - Rails, jQuery, CoffeeScriptTryRuby - Really fun way to spend 15 minutes learning some RubyTreehouse - Web design (CSS, CSS3, HTML, HTML5, Responsive Design), web development (HTML5, JavaScript, and Intro to Programming), and iOS (build iPhone and iPad apps) 1. University CoursesNon-University Resources Books 2. 3. 4. [Bonus] 5. Hacker School - once you're quite good at what you do, the next level is to attend hacker school and become even better at it!

Related: