Posts

Display title, description and image by sharing URL on facebook

Put below meta tags into your web application:   <meta property="fb:app_id" content="768103839966918" />   <meta property="og:title" content="Nice title" />   <meta property="og:type" content="article" />   <meta property="og:author" content="Arvind" />   <meta property="og:description" content="This is nice description here" />   <meta content="https://dreamermade-staging.s3.amazonaws.com/uploads/project/image/17/project_bittern-square-logo.png" itemprop="image">   <meta content='https://dreamermade-staging.s3.amazonaws.com/uploads/project/image/17/project_bittern-square-logo.png' property="og:image" >   <meta content="690" property="og:image:width">   <meta content="225" property="og:image:height">   <meta content="origin" id="

Get Gmail contacts in Ruby on rails

>> If you are looking for the functionailty for fetching the  google contacts  than you can follow the below mentioned instructions. >> Firstly You need to define the  google contact and contact groups url  in the scope for fetching the google contacts. It will allow our retrieve access token to use google contact api. >> We can define multiple scopes with the google keys :    config.omniauth :google_oauth2, client_id, client_secret, {       name: 'google',       scope: 'email https://www.google.com/m8/feeds/'   } >> In the scope I have defined  email  for   ( user's email access access )  and  https://www.google.com/m8/feeds/  for  ( read/write access to Contacts and Contact Groups ) >> I am assuming you have added the omniauth-google-oauth2 gem and added the functionality of auth login. >> After successful auth login when you will return back to the website using callback method with some josn. You can see that us

Adaptive paypal to pay multiple paypal accounts at once

Add gem:  gem 'paypal-sdk-adaptivepayments' In views: <div class="modal-body">               <%= form_for cart.build_payment, class: "form-horizontal", role: "form" do |f| %>                 <%=  f.hidden_field :cart_id, :value => cart.id %>                 <% url = "#{baseUrl}/subscriptions/subscription_create?cart_id=#{cart.id}&subscriptions=true" %>                 <%=  f.hidden_field :url, :value => url %>                 <div class="form-group">                   <label class="control-label col-sm-2" for="email">First Name:</label>                   <div class="col-sm-10">                     <%= f.text_field :first_name, class: "form-control", placeholder: "Enter the First Name", required:true %>                   </div>                 </div>                 <div class=&qu

Enable gzip compression on Elastic Beanstalk with nginx

Create nginx_gzip_configuration.config file into .ebextensions directory and then put the following script. files:   "/etc/nginx/conf.d/gzip.conf":       mode: "644"       owner: "root"       group: "root"       content: |         # enable gzip compression         gzip on;         gzip_min_length  1100;         gzip_buffers  4 32k;         gzip_types    text/plain text/html text/xml text/css application/javascript application/json;         gzip_vary on;         # end gzip configuration container_commands:   02_restart_nginx:     command: service nginx restart

Enable gzip configuration in nginx web server on VPS

To change the Nginx  gzip  configuration, open the main Nginx configuration file in  nano  or your favorite text editor. sudo nano /etc/nginx/nginx.conf Find the  gzip  settings section, which looks like this: ## # `gzip` Settings # # gzip on; gzip_disable "msie6"; gzip_vary on; gzip_proxied any; gzip_comp_level 6; gzip_buffers 16 8k; gzip_http_version 1.1; gzip_min_length 256; gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/vnd.ms-fontobject application/x-font-ttf font/opentype image/svg+xml image/x-icon; .. Save and close the file to exit. To enable the new configuration, restart Nginx. sudo service nginx restart

Install SQL sever on Ubuntu

Install SQL Server To install the mssql-server Package on Ubuntu, follow these steps: Enter superuser mode. Copy bash sudo su Import the public repository GPG keys: Copy bash curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - Register the Microsoft SQL Server Ubuntu repository: Copy bash curl https://packages.microsoft.com/config/ubuntu/16.04/mssql-server.list > /etc/apt/sources.list.d/mssql-server.list Exit superuser mode. Copy bash exit Run the following commands to install SQL Server: Copy bash sudo apt-get update sudo apt-get install -y mssql-server After the package installation finishes, run the configuration script and follow the prompts. Copy bash sudo /opt/mssql/bin/sqlservr-setup Once the configuration is done, verify that the service is running: Copy bash systemctl status mssql-server Next steps Install tools If you already have SQL Server tools,  connect to the SQL Se

Upwork Desktop app not working on Ubuntu

Download (64 bit) wget http : //launchpadlibrarian.net/233346181/libnss3_3.19.2.1-0ubuntu0.14.04.2_amd64.deb (32 bit) wget http : //launchpadlibrarian.net/233346229/libnss3_3.19.2.1-0ubuntu0.14.04.2_i386.deb Install sudo dpkg - i libnss3_3 . 19.2 . 1 - 0ubuntu0.14 . 04.2 _amd64 . deb Upwork app should work by now (Tested).

Angular filter with select tag and input value

javascript: var app = angular . module ( 'appX' , []); app . controller ( 'ctrlX' , function ( $scope ) { $scope . dataSet = [{ firstname : 'first 1' , lastname : 'last 1' , age : '24' , sex : 'F' }, { firstname : 'first 2' , lastname : 'last 2' , age : '21' , sex : 'M' }, { firstname : 'first 3' , lastname : 'last 3' , age : '24' , sex : 'M' }, { firstname : 'first 4' , lastname : 'last 4' , age : '26' , sex : 'F' }]; $scope . keyList = []; angular . forEach ( $scope . dataSet , function ( val , key ) { angular . forEach ( val , function ( v , k ) { if ( $scope . keyList . indexOf ( k ) < 0 ) { $scope . keyList . push ( k ); } }) }) }) app . filter ( 'mycust