8 Online Payment Options That Aren’t PayPal

When most people think of online payments, one name comes to mind: PayPal. But for all PayPal’s strengths, it’s a bad idea to rely on it as the single system to accept payments on your site. Monopolies are never healthy, and you need to diversify your payment channels. Why You Need PayPal Alternatives There are plenty of reasons why you should support multiple payment options, but here are several of the most important ones: Your partners or customers can’t always make or accept PayPal payments. This is the major reason to offer payment alternatives. There are always people who can’t … Continue reading 8 Online Payment Options That Aren’t PayPal

Rate this:

Top 10 Programming Languages in 2014

1. Java What it is: Java is a class-based, object-oriented programming language developed by Sun Microsystems in the 1990s. It’s one of the most in-demand programming languages, a standard for enterprise software, web-based content, games and mobile apps, as well as the Android operating system. Java is designed to work across multiple software platforms, meaning a program written on Mac OS X, for example, could also run on Windows.   2. C Language What it is: A general-purpose, imperative programming language developed in the early ’70s, C is the oldest and most widely used language, providing the building blocks for … Continue reading Top 10 Programming Languages in 2014

Rate this:

How to send emails from localhost

For beginners in the field of web development, we usually find ourselves starting out with the XAMPP package to develop using PHP/MySQL. There are times that we need to send emails from our web applications using the PHP mail() function. If you have access to your ISPs SMTP server. you may configure it in your PHP configuration file. You may use phpinfo() to help you find your configuration file. (in my xampp installation it is at F:\xampp\apache\bin\php.ini) In your PHP.ini find the ff: lines and modify them using your ISPs SMTP server. In this example I am using PLDT’s SMTP server. You may surf … Continue reading How to send emails from localhost

Rate this:

Ember Components: A Deep Dive

Ember.js is a JavaScript MVC framework that allows developers to create ambitious web applications. Although pure MVC allows a developer to separate concerns, it does not provide you with all the tools and your application will need other constructs.  Today, I’m going to talk about one of those constructs. Ember components are essentially sandboxed re-usable chunks of UI.  If you are not familiar with Ember, please check out Getting Started With Ember.js or the Let’s Learn Ember Course. In this tutorial we will cover the Web Components specification, how to write a component in Ember, talk about composition, explain the … Continue reading Ember Components: A Deep Dive

Rate this:

Sending Emails With Laravel 4 & Gmail

Sending emails is crucial for any web application. Usually, an email is sent to notify the user of some kind of activity that has taken place on the site, for example, such as when updates have been made or when new friends have been found. In this short tutorial, I’ll show you how to send emails with Gmail quickly from within a Laravel sample application by extending the functionality that we built in my last tutorial, Authentication With Laravel 4.   So, we’ll take that authentication application (you can download the previous tutorial’s source code on Github to give you a starting point) … Continue reading Sending Emails With Laravel 4 & Gmail

Rate this:

Create an image thumbnail on upload

//snippet starts <?php function createThumbnail($imageDirectory, $imageName, $thumbDirectory, $thumbWidth, $quality){ $details = getimagesize(“$imageDirectory/$imageName”) or die(‘Please only upload Images.’); $type = preg_replace(‘@^.+(?<=/)(.+)$@’, ‘$1’, $details[‘mime’]); eval(‘$srcImg = imagecreatefrom’.$type.'(“$imageDirectory/$imageName”);’); $thumbHeight = $details[1] * ($thumbWidth / $details[0]); $thumbImg = imagecreatetruecolor($thumbWidth, $thumbHeight); imagecopyresampled($thumbImg, $srcImg, 0, 0, 0, 0, $thumbWidth, $thumbHeight, $details[0], $details[1]); eval(‘image’.$type.'($thumbImg, “$thumbDirectory/$imageName”‘. (($type==’jpeg’)?’, $quality’:”).’);’); imagedestroy($srcImg); imagedestroy($thumbImg); } foreach ($_FILES[“pictures”][“error”] as $key => $error) { if ($error == UPLOAD_ERR_OK) { $tmp_name = $_FILES[“pictures”][“tmp_name”][$key]; $name = $_FILES[“pictures”][“name”][$key]; move_uploaded_file($tmp_name, “data/$name”); createThumbnail(“/location/of/main/image”, $name, “/location/to/store/thumb”, 120, 80); //120 = thumb width :: 80 = thumb quality (1-100) } } ?> //snippet ends Continue reading Create an image thumbnail on upload

Rate this:

Prevent White Flash While iFrame Loads

Problem <!– NO! Bad! –> {iframe style=”visibility:hidden;” onload=”this.style.visibility = ‘visible’;” src=”../examples/inlineframes1.html” } {/iframe} (since WP dont allow me top place an iframe with <> :p, make sure to replace { } with <>) //———————————————————————————————————————– Solution // Prevent variables from being global  (function () { /* 1. Inject CSS which makes iframe invisible */ var div = document.createElement(‘div’), ref = document.getElementsByTagName(‘base’)[0] || document.getElementsByTagName(‘script’)[0]; div.innerHTML = ‘&shy;<style> iframe { visibility: hidden; } </style>’; ref.parentNode.insertBefore(div, ref); /* 2. When window loads, remove that CSS, making iframe visible again */ window.onload = function() { div.parentNode.removeChild(div); } })(); Just include that on any page (in … Continue reading Prevent White Flash While iFrame Loads

Rate this:

HTML 5 Page Basic Page Structure

<!DOCTYPE HTML> <html> <head> <meta http-equiv=”Content-Type” content=”text/html; charset=UTF-8″ /> <title>Title goes here</title> </head> <body> <header> <nav> <ul> <li>Menu items goes here</li> </ul> </nav> </header> <section> <article> <header> <h2>Article title</h2> <p>Posted on <time datetime=”20013-12-17T16:31:24+02:00″>December 17th 2013</time> by <a href=”#”>Writer</a> – <a href=”#comments”>6 comments</a></p> </header> <p>Content goes here</p> </article> <article> <header> <h2>Article title goes here</h2> <p>Posted on <time datetime=”2013-12-17T16:31:24+02:00″>December 17th 2013</time> by <a href=”#”>Writer</a> – <a href=”#comments”>6 comments</a></p> </header> <p>content goes here</p> </article> </section> <aside> <h2>About section goes here</h2> <p>Content goes here</p> </aside> <footer> <p>Copyright 2013 Your name goes here</p> </footer> </body> </html> Continue reading HTML 5 Page Basic Page Structure

Rate this:

Adding and subtracting days, months, and years in current date using php

Adding Days $current_date = date(“Y-m-d”); $add_day = strtotime(‘+10 day’, strtotime($cdate)); $add_day = date(‘Y-m-d’, $add_day); Subtracting Days $current_date = date(“Y-m-d”); $sub_day = strtotime(‘-10 day’, strtotime($cdate)); $sub_day = date(‘Y-m-d’, $sub_day); Adding Months $current_date = date(“Y-m-d”); $add_month = strtotime(‘+3 month’, strtotime($cdate)); $add_month = date(‘Y-m-d’, $add_month); Subtracting Months $current_date = date(“Y-m-d”); $sub_month = strtotime(‘-3 month’, strtotime($cdate)); $sub_month = date(‘Y-m-d’, $add_month); Adding Years $current_date = date(“Y-m-d”); $add_year = strtotime(‘+1 year’, strtotime($cdate)); $add_year = date(‘Y-m-d’, $add_year); Subtracting Years $current_date = date(“Y-m-d”); $sub_year = strtotime(‘-1 year’, strtotime($cdate)); $sub_year = date(‘Y-m-d’, $sub_year);   Continue reading Adding and subtracting days, months, and years in current date using php

Rate this: