Ethereum and Blockchain Programming with Solidity

Got a nice read of Ethereum and Blockchain today. Downloaded the Ethereum Wallet and Mist.
Still got a lot of things to read before I can start building applications for this Decentralized Application concept. Got a new Hobby now with blockchain and cryptocurrency. whewww!

Cheers to New Wave and Synthpop!

LAMP DB Backup from Command Line Tips

  mysqldump --databases database_one database_two > two_databases.sql
 
  scp your_username@remotehost.edu:foobar.txt /local/dir
  scp -i key_file.pem your_username@remotehost.edu:/remote/dir/foobar.txt /local/dir

  some git tips
  git push https://[username]@github.com/repo.git origin [branchhere]
  git clone -b [branchhere] --single-branch https://github.com/repo.git

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;
}

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]

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>

jQuery Window Scrolling and Css Transform Animation

Here we go, our first tutorial of the year since I my rock n’roll days.

Glad to be back on track.
alright Kids, our first tutorial is using Jquery and Css to animate the size of a DIV on window scrolling.

Step 1: Your Javascript / JQuery snippet

    var $animation_elements = [$('.front-header-div-holder')];
    var $window = $(window);

    $window.on('scroll', check_if_in_view);
    $window.on('scroll resize', check_if_in_view);

    $window.trigger('scroll');

    function scaler(element,i){            
          i = (i/100)+1;          
          $(element).css("-ms-transform", "scale(" + i +")");
          $(element).css("-webkit-transform", "scale(" + i +")");
          $(element).css("transform", "scale(" + i +")");      
    }

    function fader(element,i){  
          i = ((i/100) * -1) +1;                    
          $(element).css("opacity",i);          
    }
    function check_if_in_view() {
      var window_height = $window.height();
      var window_top_position = $window.scrollTop();
      var window_bottom_position = (window_top_position + window_height);

      $.each($animation_elements, function() {
           
            if($(this).attr("class")!=undefined){
                 
                  var $element = $(this);
               
                  var element_height = $element.outerHeight();
                  var element_top_position = $element.offset().top;
                  var element_bottom_position = (element_top_position + element_height);

                  //check to see if this current container is within viewport

                  var h = 0;
                  var ename = $(this).attr('class');
                  if(ename == "front-header-div-holder"){
                        h = element_height;
                  }else{                    
                        h = element_height;  
                  }

                  if ((element_bottom_position >= (window_top_position + (h))) && (element_top_position <= (window_bottom_position-(h/2)))) {                        
                        var ename = $(this).attr('class');                        
                        if(ename == "front-header-div-holder"){
                              ename = ename.slice(0, -7);
                              scaler($("." + ename),window_top_position);
                              fader($(".front-header-title"),window_top_position);
                        }
                  } else {                      
                        var ename = $(this).attr('class');                  
                        if(ename == "front-header-div-holder"){
                              ename = ename.slice(0, -7);
                              scaler($("." + ename),window_top_position);
                              fader($(".front-header-title"),window_top_position);
                        }                                              
                  }

            }

           
      });
    }

Step 2: Your HTML

<div class="front-header-div-holder">
     <div class="front-header-div">
          <div class="front-header">
              <!-- your load of BS here -->
          </div>
      </div>
</div>

Step 3: Your CSS
Code as you please.

Drop me a question if you have one. Ciao!