Adding Custom Hook on Contact Form 7

How to add Custom Hook on Contact Form 7

/*
    Prevent the email sending step for specific form
*/

add_action("wpcf7_before_send_mail", "wpcf7_do_something_else");  
function wpcf7_do_something_else($cf7) {
    // get the contact form object
    $wpcf = WPCF7_ContactForm::get_current();

    // if you wanna check the ID of the Form $wpcf->id  
    $submission = WPCF7_Submission::get_instance();

    $yourname   = $submission->get_posted_data('your-name');    
    $youremail  = $submission->get_posted_data('your-email');


    return $wpcf;
}
It's only fair to share...Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn

General Steps on setting up SSL in your Website

1. Buy SSL
2. Generate CSR
3. Copy Generated CSR to SSL location setup
4. download crt from ssl location
5. update install crt to hosting server
6. Install SSL

Once SSL in installed. Force make a 301 redirection to all links via .htaccess

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRUle ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

It's only fair to share...Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn

Setting Virtual Host with XAMPP

<VirtualHost *:8080>
    DocumentRoot "C:\DIR"
    ServerName domain.localhost
    <Directory "C:\DIR">
        Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride All
        Require all granted
    </Directory>
 php_flag display_errors on
    php_value error_reporting 6143
    php_flag log_errors on
    php_value error_log "C:\DIR"
</VirtualHost>

(e.g. for Xampp 1.7.7. )

<VirtualHost *:80>
 DocumentRoot C:/DIR
 ServerName domain.local

 <Directory "C:/DIR">
  Options Indexes FollowSymLinks Includes ExecCGI
  AllowOverride All
  Order allow,deny
  Allow from all
 </Directory>
</VirtualHost>
It's only fair to share...Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn

How to handle a Responsive 5 Column layout using Zurb’s Foundation 5

This is a 5 column responsive layout that will adjust in 3 screen sizes small (phone screens), medium (tablets) and large (PC).
1 columns for smart phone screens, 3 rows and 2 columns on first 2 rows on tablet screens and 1 row with 5 columns on large screens like laptop and PC.

Here you go kids! You’ve learned new tricks today!

    <div class="row">
        <div class="large-5 columns">
            <div class="row">
                    <div class="medium-12 columns">
                    <div class="row">
                        <div class="medium-6 columns">#</div>
                        <div class="medium-6 columns">#</div>
                    </div>
                </div>
            </div>
        </div>
        <div class="large-5 columns">
            <div class="row">    
                <div class="medium-12 columns">
                    <div class="row">
                        <div class="medium-6 columns">#</div>
                        <div class="medium-6 columns">#</div>
                    </div>
                </div>
            </div>
        </div>
        <div class="large-2 columns">
            <div class="row">        
                <div class="medium-12 columns">
                    <div class="row">
                        <div class="medium-12 columns">#</div>                    
                    </div>
                </div>                        
            </div>
        </div>
    </div>
It's only fair to share...Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn

C# Base Repository Interface

For those Developers using Repository Pattern, this is the ideal structure of your Base Repository Interface.

public interface IBaseRepository{
  Task<IEnumerable<Entity>> FindAll();
  Task<IEnumerable<Entity>> FindAll(Expression<Func<Entity, bool>> predicate);
  Task<Entity> GetByID(int id);
  void Delete(int id);
  Task<Entity> SaveOrUpdate(Entityentity);
  Task<Entity> SaveOrUpdate(int id, Entityentity);
  void BulkSaveOrUpdate(List<Entity> entities);
}
It's only fair to share...Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn