Today's Question:  What does your personal desk look like?        GIVE A SHOUT

 WEB


  Regular expression to get html meta description

When we need to process a HTML page source code, we often need to retrieve the meta description of the page besides the links in the page. This description is usually located in <meta> tag of a HTML page. The meta description is very useful for search engine index. How can we retrieve the meta description? If we use a regular expression, we can easily get the meta description.In JavaScript, the regular expression looks like :var pattern = /<meta.*?name="description".*?content="(.*?)".*?>|<meta.*?content="(.*?)".*?name="description".*?>/i;since the description is the content i...

16,190 0       JAVASCRIPT HTML REGULAR EXPRESSION META DESCRIPTION


  Tips and tricks about JavaScript from Google

JavaScript is now a very popular client side language. It's flexible, powerful but easy to make mistakes. So good programming style is better for you to write efficient and readable JavaScript codes. Here are some tips and tricks about JavaScript from Google.True and False Boolean ExpressionsThe following are all false in boolean expressions:nullundefined'' the empty string0 the numberBut be careful, because these are all true:'0' the string[] the empty array{} the empty objectThis means that instead of this:while (x != null) {you can write this shorter code (as long a...

16,117 1       JAVASCRIPT GOOGLE CODING STANDARD


  PHP to get access token for Twitter app

Previously we wrote an article about getting access token for Facebook app--PHP to get access token for Facebook app. Today we will introduce how to get access token for Twitter app using PHP.Since now Twitter is also using OAuth 2.0 to allow some web apps to access some users information on behalf of one user. They provided some APIs for developers to easily get them integrated with their own websites. The first step to get all these done is how to get the access token, the access token seems like the password to one user's account on Twitter.First, we need to download the SDK, in this articl...

16,093 0       PHP TWITTER OAUTH ACCESS TOKEN


  Why does LinkedIn migrate to NodeJS from Ruby?

Node.js, the server-side JavaScript-based software platform used to build scalable network applications, has been all the rage among many developers for the past couple of years. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices. Because of these advantages, there are many websites are migrating to Node.js.One of them is LinkedIn.LinkedIn was initially built on Ruby which contained 60K lines of code, later in 2011, LinkedIn started to rebuild their core mobile servi...

15,995 0       RUBY LINKEDIN NODEJS


  Free jQuery UI themes

jQuery UI is a jQuery User Interface library, it provides many frequently used components and functions. It consists of datepicker, slider, progress bar and drag and drop support etc.Also it has many themes, you can use ThemeRoller to customize your own theme. But with ThemeRoller, we can still find the shadow of jQuery UI.If you want some highly customized, free and high quality jQuery themes such as Bootstrap, Windows-Metro, then the following themes may suit you.1. jQuery UI BootstrapjQuery UI Bootstrap is a jQuery UI theme, it is encouraged by Twitter's Bootstrap, it introduces slickness i...

15,868 0       JQUERY UI THEME


  Send email using PHPMailer on GoDaddy hosting

According to PHPMailer troubleshooting guide, GoDaddy has a very strict rule on sending email using PHPMailer.Popular US hosting provider GoDaddy imposes very strict (to the point of becoming almost useless) constraints on sending an email. They block outbound SMTP to ports 25, 465 and 587 to all servers except their own. This problem is the subject of many frustrating questions on Stack Overflow. If you find your script works on your local machine, but not when you upload it to GoDaddy, this will be what's happening to you. The solution is extremely poorly documented by GoDaddy: you ...

15,699 2       PHP GODADDY PHPMAILER


  Latest PHP patch cannot fix the bug

On Wednesday(2012-05-02), a remote code execution vulnerability in PHP was accidentally exposed to the Web, prompting fears that it may be used to target vulnerable websites on a massive scale. The bug itself was traced back to 2004, and came to light during a recent CTF competition.A CERT advisory on the flaw explains: “When PHP is used in a CGI-based setup (such as Apache's mod_cgid), the php-cgi receives a processed query string parameter as command line arguments which allows command-line switches, such as -s, -d or -c to be passed to the php-cgi binary, which can be exploited to dis...

15,616 0       PHP BUG PATCH BYPASSED


  Use progressive JPEG to improve user experience

JPEG image files can have two different save types : Baseline JPEG and Progressive JPEG. Both of them have the same extension name but with different display effect.Baseline JPEGThis type of JPEG files are scanned from top to bottom consecutively, each line of the image data will be saved sequentially. When opening this kind of images, data will be displayed with the save order line by line until all the data are read. If the image size is very large or network speed is very slow, the image will be displayed line by line from top to bottom.Progressive JPEGDifferent from baseline JPEG, pro...

15,527 1       USER EXPERIENCE PROGRESSIVE JPEG BASELINE JPEG