Skip to main content

Posts

Showing posts from February, 2018

Still don’t know anything about Blockchain? Read this to know everything!

Blockchain was the idea originally developed by a group of people known by the pseudonym, Satoshi Nakamoto . But since then, it has evolved into something greater, and the main question every single person is asking is: What is Blockchain? By allowing digital information to be distributed but not copied, blockchain technology created the backbone of a new type of internet. It was originally designed for the digital currency named Bitcoin. Of course you have heard the term Bitcoin, Bitcoin is one of the most popular cryptocurrencies there are. That much popular Bitcoin has become and the main reason behind the tremendous success of bitcoin is Blockchain. Do you know how to use the internet? Of course you do but you don’t know how it works, do you? Because you don’t need to know how the Internet works, just to use it. Everyone who has invested in bitcoin is unknowingly using Blockchain. Just like the Internet, you don’t need to know how blockchain works to use it. Howev

Instagram API Integration to get Instagram feed to your website

To integrate the Instagram API in your website, you need you have to follow following process Log in to Instagram and open this page https://instagram.com/developer/clients/manage Click on the button «Register a New Client». Then Fill all the Mandatory fields, in Valid Redirect URIs specify your valid redirected URI and click «Register». Then click «Manage» button to obtain both Client ID and Client Secret of your just registered app. Use the Client ID and Client Secret to generate access token with this link https://rudrastyh.com/tools/access-token . You can find more info there as well. A Short Introduction about sandbox mode All newly created apps start in Sandbox Mode Apps in Sandbox mode have access only to 20 latest media of an access token owner (and sandbox users invited to your app). To avoid these restrictions you should send your app to approval. We can get instagram feed in our website by two ways By User ID By a Username How can

Pagination in Rails With the will_paginate-bootstrap Gem

To divide large number of records into multiple parts, we use pagination. It allows user to display a part of records only. Loading all records in a single page may take time, so it is always recommended to created pagination. In will_paginate-bootstrap gem integrates the Bootstrap pagination component. The usage for this is extremely simple and it magically works. So let’s take a look at adding this. STEP 1. gem install will_paginate-bootstrap STEP 2. Open app/controller/posts_controller.rb and it adds necessary parameters in the resultant collection of record to display pagination links in front-end (.erb). Parameters: :page- This is parameter sent in Query String. Based on this, which records are to be fetched is decided. i.e. Offset is decided :per_page- This is Number of results that you want to fetch per page i.e. From offset (.erb) limit – per page limit for the paginated result data offset – current paginated data set -> to show current page STE

How to make Search Engine Friendly url in Ruby On Rails?

FreindlyId gem is used to make friendly looking URLs i.e it lets us replace id’s in the URL with the string. It also prevents hacking of the web-page since the id gets hidden by the slug. Before friendly_id: After friendly_id : Here are the simple steps to follow: Step 1: Add gem “friendly_id” to the Gemfile and run “bundle install” on terminal. A] On an existing application : Step 2: Run “rails g migration AddSlugToJobs”. In this case, “slug” is the column name which is adding into existing “jobs” table. Slug : Slug is the part of the URL. It is the slug which makes the URL user friendly. Slug rules states that the string in the URL is separated by dash (-). Its rule also states that the letters in the URL are in lowercase. Step 3: Add the following code to the migration file : In my application,I have migration file “20180109135747_add_slug_to_jobs.rb” in “db/migrate/20180109135747_add_slug_to_jobs.rb”. In this step I am a

What is Digital Music Distribution Services

Artists or Bands create songs. These songs are recorded in the digital format like mp3, wav, aac etc. Every artist would like to promote their songs and make money out of it. This is possible by uploading the songs to different digital platforms like itunes, amazon, spotify. Listeners goto these websites to buy, download and listen to the songs. Each website send a revenue sheet with the amount that is collected by the digital platforms which are also called as DSP (Digital Service Provider). This is how an artist monetize the digital content created by him/her. Digital Music Distribution Know details of what music distribution is & how it works. The process of uploading a song on a DSP is different for each DSP. Also keeping a track of revenue from each DSP is also time taking. Artists are more creative and do not like to spend a lot of time with the DSP in managing their contents. This creates a need of Music Distribution System. Music Distribution System is one

Enabling Cross Origin Resource (CORS) Sharing In Rails

How can my application share it's resources with another client? This is where the CORS, or Cross Origin Resource protocol comes in. CORS introduces a standard mechanism that can be used by all browsers for implementing cross-domain requests. The spec defines a set of headers that allow the browser and server to communicate about which requests are (and are not) allowed. CORS continues the spirit of the open web by bringing API access to all. What is a cross-site request? Cross-site HTTP requests are HTTP requests for resources from a different domain than the domain of the resource making the request. Such requests are subject to security-based restrictions. To handle this restrictions, and get around them in a secure manner, W3C developed CORS. What is CORS? The Cross-Origin Resource Sharing (CORS) mechanism provides a way for a server to support cross-site requests and enable the secure transfer of data across different domains/sites. How can our Rails AP