Happy Friday Everyone,

Friday Hug is a weekly list of best articles & tutorials from all across the web, curated by @icicletech team which covers Ruby on Rails, React Native, Mobile and JavaScript.

confreaks.tv pageGoogle I/O 2017 has crossed midway and whole lot of interesting things have already been announced from Android updates, Firebase updates, cloud infrastructures, machine learning, etc. Some more updates are in the queue for today.

This week’s roundup covers topic such as Ruby backend performance guide, Testing HTTP requests with Elixir, reduce weback bundle size and lot more.

Contents
  1. Ruby On Rails
  2. Elixir
  3. Mobile
  4. ReactJS/React Native
  5. JavaScript
  6. HTML & CSS

Ruby on Rails

Ruby Backend Performance Getting Started Guide - How and where to make performance checks to make the Rails app faster.

What if we organized code by features? - A code organisation approach as per the application features and behaviour.

Fighting the Hydra of N+1 queries - How to tame the N+1 anti-performance query pattern using bullet gem.

Elixir

Metaprogramming Without Macros - Metaprogramming without writing macros, just using quote and unquote, and functions from Code and Macro.

Testing HTTP requests in Elixir with ExVCR - A basic tutorial to setup ExVCR and how to filter sensitive data in the tests.

Why Changes in Phoenix 1.3 are so Important? - This article will try to guide through the most important changes in the phoenix project.

ReactJS/React Native

What's New in Create React App - Find out all about new features which were released with Create React App update such as support of webpack 2, runtime errors, etc.

“Thinking in React” — A paradox statement - Discussing about three basic principles of React components and it’s different implementations.

Deep Linking Your React Native App - How to add deep linking to a React Native app for both iOS and Android using React Navigation.

Mobile

Running SwiftLint in Continuous Integrations - Lessons learned integrating Danger and SwiftLint

Stored Properties In Swift Extensions - Workaround to overcome limitations with stored properties in Swift Extensions.

How to Build a Collaborative Realtime Android Todo App - Tutorial to build an interactive todo list for Android allowing multiple users to add/remove tasks in realtime.

JavaScript

3 Ways To Reduce Webpack Bundle Size - Steps to optimize the webpack bundle size.

Vue.js Is Good, But Is It Better Than Angular Or React? - Comparison of Vue.js with Angular & React and winning factors present in it.

Implementing Auth Guard with Componentless Route in Angular - Guide for understanding componentless route in Angular and to setup Auth Guard with it.

HTML & CSS

Fluid Responsive Typography With CSS Poly Fluid Sizing - Guide to create scalable, fluid typography across multiple breakpoints and predefined font sizes using well-supported browser features and some basic algebra.

Enforcing CSS Syntax Style - Best practices and style to write the CSS code.

Tips For The Week

Rails Performance: Automatically clear logs

Log files are used to track the actions that happen in the server. If you do not pay attention, you may lose precious space on your hard drive to the log files. You can clear the log by running the following code snippet

rake log:clear
You can automate it during server startup by adding this snippet to the initializer:
# config/initializers/clear_logs.rb

if Rails.env.development?

MAX_LOG_SIZE = 2.megabytes

logs = File.join(Rails.root, 'log', '*.log')

if Dir[logs].any? {|log| File.size?(log).to_i > MAX_LOG_SIZE }
$stdout.puts "Running rake log:clear"
'rake log:clear`
end
end
Keep your logs clean, save space, and have peace of mind.

Reference: Ruby on Rails Ninja

Use Time.zone.now instead of Time.now

Using default Ruby Time, Date and DateTime classes will not show times in the time zone specified by config.time_zone in application.rb.

Time.zone = "Alaska"
Time.now
Date.today

These show the local time, not the time in Alaska (unless you're already in Alaska).

Refactor

You should instead use ActiveSupport methods of Time.zone to pickup the Rails time zone.

Time.zone.now
Time.zone.today
Time zone bugs are particularly tricky when the production server is set to a different time zone (often UTC) than the development machine. Using 'Time.zone` avoids this breakdown of dev/prod parity.

Reference: Rails Best Practices

Published in friday-hug, javascript, web-development, ruby-on-rails, react-native, mobile | Tagged with android, css3, elixir, erlang, friday-hug, reactjs, mobile, javascript, ruby-on-rails, web-development

CATEGORIES
web-development
javascript
ruby
ruby-on-rails
tutorials
startups
events
products
devops
mobile

TAGS
web-development
javascript
frameworks
ruby
open-source
ruby-on-rails
tutorials
reactjs
front-end
startups

MORE

RSS

X

Talk to us, that's always a good idea!