Friday, June 17, 2016

Realtime App Development with RethinkDB and React Native

A realtime app keeps a user up-to-date with the information they want to know, when they need it. A user doesn't need to constantly refresh a window to get the latest updates, a server behind the app will push updates to the app automatically. In this tutorial I'm going to show how to create a realtime news app with RethinkDB and React Native.

Continue reading %Realtime App Development with RethinkDB and React Native%


by Wern Ancheta via SitePoint

How to Automate and Optimize Your WordPress Development and Testing on Pantheon

Rails Image Upload: Using Paperclip in a Rails Application

In the first two parts of this series, I showed you how to enable image uploading in Rails using CarrierWave. In this part, you will see how to do so using Paperclip.

Paperclip is a Ruby gem provided by thoughtbot. It was created to make file attachment very easy. In this tutorial, you will see how to use Paperclip alongside Devise.

Without much talk, let's get busy.

Paperclip requires the installation of ImageMagick on your machine. You need this for image processing. To install ImageMagick, use any of the steps below, depending on the type of machine you use.

Mac Users:

brew install imagemagick

Ubuntu users:

sudo apt-get install imagemagick

Rails Application Generation

Use your terminal to generate a new application.

rails new paperclip

Open up your Gemfile and add the necessary gems:

gem 'paperclip'

gem 'devise'

Run bundle install when you are done.

Devise Setup

From your terminal, install devise using the command below:

rails generate devise:install

When that is done, you can now generate your User model:

rails generate devise User

Migrate your database after.

rake db:migrate

Generate your devise views.

rails generate devise:views

Using your text editor, navigate to app/views/layouts/application.html.erb and add the following code just above the yield block.

Paperclip Integration

Due to security reasons, we have to permit parameters in the Devise controller. Thanks to the awesome team behind Devise, doing this is easy.

Open up app/controllers/application_controller.rb and paste in the following lines of code.

Open up your User model and make it look like this:

You need to add an avatar column to your Users table. There is a rails command that makes this possible from your terminal.

rails generate migration add_avatar_to_users

That will create a new migration in db/migrate. Open it up and paste the below code:

Run your migration

rake db:migrate

Add Avatar to Devise Forms

You will edit your registration new form app/views/devise/registrations/new.html.erb and edit the form app/views/devise/registrations/edit.html.erb to what I have below:

Kick off your browser and check out what you have.

For a standard application, you might want to check if a user who wants to edit his or her profile already has an avatar uploaded. This is easy to implement in your registration edit file.

Open up the registration edit file and make it look like this:

Can you see what changed?

In the above code, there is a conditional statement to check if an avatar already exists for a user using the line <% if @user.avatar? %>. If this returns true, the next line gets run, else it does not.

Security Validations

Validation is always important when enabling uploading features in your web application. Paperclip comes with measures to secure your application.

You can use any of the validations below in your model.

Conclusion

You might want to consider Paperclip as you build your next web application. It has a great team supporting it.

To explore other features not covered in this tutorial, check Paperclip's GitHub page.


by Kingsley Silas Chijioke via Envato Tuts+ Code

How to Get Your Videos to Perform in Search

ms-podcast202-amy-schmittauer-600

Do you create YouTube videos? Want to get them seen? Amy Schmittauer is here to help you discover how to get your videos to rank in search. More About This Show The Social Media Marketing podcast is an on-demand talk radio show from Social Media Examiner. It’s designed to help busy marketers and business owners discover [...]

This post How to Get Your Videos to Perform in Search first appeared on .
- Your Guide to the Social Media Jungle


by Michael Stelzner via

Locomotive

Locomotive stands apart from other agencies and offers a wide array of creative and strategic services for brands, companies, foundations and other remarkable organisations.
by via Awwwards - Sites of the day

3D-Tour Hero : Script of WebGL Based Virtual Tour

This scripts helps you to add Virtual 3D Tour to your site. Purchase include the source of Visual Virtual Tour Constructor! It helps to create the Virtual Tour in visual mode in your site admin panel!

Features:

  • Maximal Support in Browsers due to WebGL & Canvas Renderers
  • HTML5 3D-Tour Redactor for Admin Panel
  • Convenient and Great API
  • Control Settings (Speed & Direction of ‘Hand-Rotate’, ‘Zoom’, ‘Auto-Rotate’)
  • Start Camera Direction
  • Load Animation
  • Links to 3D Tour creation
  • Helper to easy Getting the Point on 3D-Scene to link snap
  • Export & Import player data with all configs in JSON format

The post 3D-Tour Hero : Script of WebGL Based Virtual Tour appeared first on jQuery Rain.


by Admin via jQuery Rain

Bootstrap Select Togglebutton with jQuery

JQuery plugin for converting select input to friendly bootstrap buttons group.

The post Bootstrap Select Togglebutton with jQuery appeared first on jQuery Rain.


by Admin via jQuery Rain