3 Ruby Gems to Code Analysis

By using Rails We can explore an endless of tools that We can use a more efficient and quick code. Also, We can find tools that allow us to review our implementation. 
There is a lot to be listed and ready to go, but We want to show you which ones are vital for Us here in 4Geeks.

1. Rubycritic

This gem generates a full report about the current quality of our code, by using different gems of analysis like ReekFlog y Flay.

Installation

gem 'rubycritic', require: false

Execution

$ rubycritic
This will generate a HTMl document where We can find the state of our code and also be able to analyse all the smells returned. Here, in 4Geeks this gem is used often to check and confirm that the code written is using the Rails standards and quality. 

2. Rubocop

Rubocop is a gem very interesting, which is a static code analysis, totally based on the ruby style guide, who is the one that provides all the standards that ruby demands. This gem will show to us a detailed report  with all the rule violations that we have in our code, for example: useless variables, methods and arguments or redundant use of ruby methods. 

This gem allow us to check in different formats all the results. Starting by checking the code directly in the console, in a JSON file or a HTML document. Here in 4Geeks we enjoy using HTML format that way we can show in a good visual form to the clients or partners all the results of the analysis.

Also Rubocop, bring to us a configuration set, that way We can be able to modify some alerts if We think It’s not necessary to follow some ruby style guide rule, so, our teams follow their own rules in that scenario.

We highly recommend to run this gem before send you code to review, so, you can confirm that everything you wrote is under the standards of your team and ruby. 

Instalation

gem 'rubocop', require: false

Execution (recommended)

$ rubocop --format html -o rubocop.html

3. Brakeman

This gem is very important, because it show us a complete analysis of possible failures in our code security. It shows the results by classifying them by level: High, Medium, Low. Thanks to that we can decide where to check first. We have to take in consideration that by fixing this stuff won’t assure total security, but it will very helpful to determine certain errors.  

Installation

gem 'brakeman', require: false

Execution (recommended)

$ brakeman -o output.html

Conclusion

We went through the most known gems in code analysis, as we saw, We can use them to reduce code smells and increase code security. Now, We have to explore other options We can not delimited our selves and our projects to use only those tools, there are a lot of options around internet and also, We can think about build one, why not ? 

Setup and Run an Angular 4 Project

Angular 4 was available on past March 23, with some new features and changes, that make it an smaller and faster framework to build modern web and mobile application.

Some features like: 
  • a powerful View Engine
  • Animation Package
  • Improved *ngIf and *ngFor
  • TypeScript 2.1 and 2.2 compatibility
  • Angular Universal: it allow to run Angular on a server.
Ok, let’s start creating and running an Angular 4 project, from scratch.

Install Node and NPM

First, you need to have Node and NPM.  Verify that you are running at least node 6.9.x and npm 3.x.x by running node -v and npm -v in a terminal/console window. Older versions produce errors, but newer versions are fine.
If you are from Mac, you can use brew (brew install node). If you are from Linux, you can use the nodesource repos.

Create a new project with Angular CLI

Angular CLI is a very easy tool, that can help you create some initials scripts, like the project, providers, components, modules, etc.  Check out the complete documentation for more details.
Run this two commands. The first one will create the environment and will install core requirements. 
The second one will create all the directories and files that you need for your project. 

npm install -g @angular/cli


ng new my-new-app

and basically that’s all. 

Run the project

To run this project, you just run this command. This will compile your code, and open your web browser on http://localhost:4200
ng serve –open
Hope you can replicate this on your local, and share with me if you are having troubles.
I’m right now playing with Angular 4 and Firebase. A new post soon 馃檪

Identifying videos with Google Video Intelligence

Google is the API-master company in the world, putting awesome ideas and helping a lot of companies around the globe to make great software, and now is the opportunity for video.

Many months ago Google launched a service to analyze photos… I mean, to understand photos. People, animals, objetcs or whatever.

Google Video Intelligence is here, and let us dream bigger. Data is the king.

Google Cloud Video Intelligence API makes videos searchable, and discoverable, by extracting metadata with an easy to use REST API. You can now search every moment of every video file in your catalog and find every occurrence as well as its significance.

It quickly annotates videos stored in Google Cloud Storage, and helps you identify key nouns entities of your video, and when they occur within the video. Separate signal from noise, by retrieving relevant information at the video, shot or per frame.

Now is easier to understand videos by extracting actionable insights from video,  understand the overall content of your video catalog, identify the presence of a signal buried in noise.

Take a look at this demo, and see how this new tool can help to make better businesses, though an API.

And let us to know if can help you on develop your next big thing… just drop us an email.

Livestream: Introducci贸n a ReactJS, con Erifranck

Hola. Hoy, el equipo de 4Geeks University estuvo llevando a cabo el primer livestream, y lo dedicamos a ReactJS, como una de las librer铆as m谩s potentes, creada por Facebook e impulsada por la comunidad.

4Geeks University es una plataforma de educaci贸n online, en el cual el equipo est谩 preparando el lanzamiento.


Comparte este post con tus amigos. Queremos que todos puedan aprovechar el conocimiento que estamos compartiendo con todos ustedes.

Suscr铆bete al canal de YouTube para que recibas notificaci贸n cuando se transmitan m谩s eventos en vivo, y puedas hacer preguntas.

Our participation at Outsource2LAC 2017 event

Hi folks! On this week we participated at Outsource2LAC event here in San Jose, Costa Rica. Outsource2LAC has become the most prominent Outsourcing and Offshoring forum.

It’s all about business meetings, and 4Geeks was there!

4946 Business Meetings. 47 Conferences. 190 Speakers.

So, we connect with some companies in Mexico, Canada and USA to support them on their digital product creation and management.

See you at Outsource2LAC 2018 in Trinidad & Tobago.

Teams, Microsoft鈥檚 Slack rival, opens to all Office 365 users

By Ingrid Lunden.

After unveiling a limited preview of Teams in November last year, Microsoft is now rolling out its collaboration and communication platform, positioned as a rival to Slack, more widely: Teams is now available, and free, for all 85 million monthly active users of Office 365, Microsoft鈥檚 suite of cloud services and apps as a web app and native apps for Windows, iOS and Android.

Along with it, the company is announcing some 150 integrations with third-party services like Asana, Zendesk and Hootsuite, alongside the ability to chat (with other humans or with bots), security services, customization options and more.

(No word on when and whether Teams would expand outside the Office 365 ecosystem: 鈥淲e鈥檝e had some discussions but right now remain focused on our huge user base,鈥 noted Mira Lane, Microsoft Teams鈥 UX lead.)

The wider launch comes in the wake of some reasonable success so far. Microsoft said the Teams preview has had some 50,000 organizations sign up and try out the service.

That figure includes both companies that have tried it as well as those who have stayed on to become active users, and Microsoft would only tell me that many stay on, with the number of people per company ranging from small groups to organizations with hundreds of users. (Notable customer wins, it said, include Accenture, Alaska Airlines, Conoco Phillips, Deloitte, Expedia, J.B. Hunt, J. Walter Thompson, Hendrick Motorsports, Trek Bicycle and Three UK.)

For a new app that is coming to the market after the meteoric rise of Slack, as well as other competing services like Workplace from Facebook and Hipchat from Atlassian, some might argue that Teams and Microsoft are late to the game.

In its favor, Microsoft is banking on the low-friction aspect of the service: Those being targeted are already using Microsoft apps like Excel, Word, PowerPoint, OneNote, SharePoint and Power BI, so there will be familiarity and convenience. And it鈥檚 free to try out.

As we noted when Microsoft debuted the service in November, Teams throws a lot at the user from the start. If you鈥檝e ever used something like Word or Excel, you know that this is a very Microsoft approach.

The basic interface follows a lot of what you might already know for workplace collaboration products, which are often based around a left rail that lists discussion groups, and the main stream to the right that charts conversations.

Within that, Microsoft takes you into a pretty huge range of different options that tap into its many other products. These include direct chats, the option to hold audio and video calls, the ability to call in spreadsheets and other documents, run some analytics and more, along with spaces for 鈥渆vergreen鈥 content as well as others for more rapidly changing data.

On top of this, Microsoft has built a chatbot framework that initially is dedicated to helping you use Teams better, but over time will include integrations built by developers to bring in a variety of other services too, similar to Slack, Messenger and a number of other chat services.

This seems to be intentional, not accidental or a sign of disorganization at Microsoft.

鈥淭he shift to modern working styles that are open and transparent by default are part of our core philosophy of one size does not fit all,鈥 Lane said in an interview. 鈥淥rganizations are different in how they do business and collaborate. Some will use multiple tools, for example Yammer for a CEO to speak to the whole organization, but for more tight collaboration they鈥檒l use Microsoft Teams. We think it鈥檚 okay to be fluid.鈥

The strange balance that Microsoft is trying to strike here is between giving you too much to do, too many options; but also the lingering question of whether all this will be enough to sway users to the service.

This is not just an issue when considering Microsoft Teams compared to products from different companies, but when comparing it to Microsoft itself, which already has a number of applications where users can communicate and collaborate with each other, including Yammer, Skype and more.

So far, the experience has been that while some services have definitely gained traction (Slack now has more than 5 million daily active users, and 1.5 million paid accounts), given that there are millions more businesses in the world, there is still a lot to play for, and a lot to win. 鈥淲e鈥檙e seeing people kicking the tires on all products and looking for something more enterprise grade,鈥 Lane noted.

Source: https://techcrunch.com/2017/03/14/teams-microsofts-slack-rival-opens-to-all-office-365-users/

Get more customers with Google Adwords

Building a product or service is as important as selling it. So, the passion must be the same.

We were helping startups to buil their products, now we are ready to help startups to get real customers by the best and smart way: online advertising.

Please, take a look at the following video on how Google Adwords can help you to get more customers by reaching the right people at the right time. Then, contact us and let us advise you.

We are hiring software devs in Guadalajara, Mexico.

Hey guys! Hope you are doing well. Our team is expanding, and we are opening a new office in Guadalajara, Mexico.

Right now we have some open job positions, fulltime, with some common required skills like:
– good communication skills
– speak in English

Compensation:  25000 MXN – 35000 MXN.

Jobs:
– .NET (C#) Web Developer: https://goo.gl/gzt9W6
– Java Senior Developer: https://goo.gl/YPN5MD
– Python Senior Developer: https://goo.gl/d4nN6M
– JavaScript Developer: https://goo.gl/gHJgCi
– FrontEnd Fullstack Developer:   https://goo.gl/ZFjLG8

How to apply?
Please send your resume to jobs@4geeks.info

To be tuned, please bookmark  http://4geeks.info/jobs 

Set virtualenv on Python projects

Sometimes we need different python packages versions in different projects. It’s like to have 3 computers, and running a different Python project on each computer, and the first project is using Django 1.8, the second project Django 1.7, and the third project Django 1.9.4.

Really I need 3 different computers to do that? Not at all.

Virtualenv is the hero, downloadable from pip, and it make our life easier. It let us to have a lot of Python projects, using their different dependence and versions, all living at the same computer but different environment. Check out the next image.

To install virtualenv, just you need to type:
pip install virtualenv 

This line will download, install and config virtualenv and their own dependence.

Now we are enabled to create a new virtual environment over any existing Python project. For this example, we already have a project called “mall4g”. We need to browse to the directory and run the command, where “mall4g” is a directory.

virtualenv mall4g

This will create extra directories:  lib, bin, include, local. Probably you want to ignore that directories when you push your code to Git.

Now, to activate:

source bin/activate

Done. Now, all python packages installed by using pip, will be located automatically under our “local” directory. No stress. No more problems.

How we are deploying Django projects to AWS

Internally, we are constantly looking for the best way to deploy some Django projects to AWS.  Some people prefer to use automated process (yeah! automated deploys).

This is just a step. There are a lot way to do it. Here the stack. Let’s go!

AWS:
I personally prefer Google Cloud Platform. Probably I will write about that on this blog soon.

I’m using a EC2 instance, with Ubuntu.
I’m clonning the  Git repo under  /home/ubuntu by using the ubuntu user.
Virtualenvwrapper:
Virtual environment is an important requirement. I have used both virtualenv  and virtualenvwrapper; in this case I used virtualenvwrapper, and all Python and pip packages are installed in a separated folder.
Gunicorn:
Gunicorn is just an HTTP server for Python projects. 
I have started my Django project on server trough Gunicorn on a local hostname and port (http://localhost:8000). 
Supervisor:
I use Supervisor to convert my project in a daemon. That’s it. So, if I restart the server, this daemon will be started automatically.
This is my  /etc/supervisor/conf.d/myproject.conf
[program:myproject]
command=/home/ubuntu/myproject/start_gunicorn.sh
autostart=true
stdout_logfile=/home/ubuntu/logs/gunicorn.log
stdout_logfile_backups=20
stdout_logfile_maxbyes=20MB
Start_gunicorn.sh  is just a bash file to launch Django trough Gunicorn. Something like:
gunicorn myproject.wsgi:application -w 3 --bind=127.0.0.1:8000 
Nginx:
Nginx is very cool HTTP/Proxy server. I’m using Nginx as a proxy, to serve the local project to the web. 
I’ts like make enabled  localhost:8000  from  mydomain.com. 

Nginx is also serving all the Django static files, and make it visible from  /static.
server {
listen 80;
server_name mydomain.com;
client_max_body_size 5M;
charset utf8;
keepalive_timeout 6;

access_log /home/ubuntu/logs/nginx.access.log;
error_log /home/ubuntu/logs/nginx.error.log;

location / {
proxy_read_timeout 800;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:8000/;
}

location /static {
alias /home/ubuntu/myproject/static;
autoindex on;
}
}

If you need help with your deployment or managing your stack, please contact us.

Have any questions? Have a better way?  Please post it below.