I always forget all those handy hints in Ruby on Rails, while using my Rails console. Here I will drop some very useful console commands to get some daily jobs done: Hint No.1 Sometimes we change the code in a file. In that case we can reload the changes in the rails console by using […]
Read more at the sourceAll posts by Marcello
Kanban Certification
IBQMI® Kanban Certification Keeping ahead of the competition in the business market has become an essential goal for companies. Many industries are saturated and competition is not only becoming tougher but closer. Kanban at a glance Kanban brings inventory levels and actual consumption side by side. The process is designed to produce an indicator that […]
Read more at the sourceRails scaffold data types
If you work with a scaffold it can happen to anybody to forget the datatypes. Here is a cheat sheet for all the Rails 4 (ActiveRecord migration) datatypes at a glance: 12345678910111213 :binary :boolean :date :datetime :decimal :float :integer :primary_key […]
Read more at the sourcegit push heroku master is asking for authentication
In this post I show you how to fix the authentication problem with heroku. If you want to deploy your branch to heroku using this command 1$ git push heroku master and git want an authentication like this 12Username for ‘https://git.heroku.com’: Password for ‘https://git.heroku.com’: then the repository is not pushed, because heroku will not allow […]
Read more at the sourceSecurity issues for CQ/AEM Instances
Because I was checking some security issues in my job, I was concerned with exploits for the Adobe AEM system. We can find a lot of old Adobe AEM Versions out there. To find Websites using Adobe AEM, just go to google and enter: 1inurl:content/geometrixx By doing this, we will get a lot of results […]
Read more at the sourceRuby on Rails Database Indexes
Handy hint for better database performance in Ruby on Rails: Always add DB index in your Migration! By default, rails does not add indexes automatically for foreign key, you should add indexes by yourself. If you want to speed up your performance, I suggest to add an index for – foreign key – columns that […]
Read more at the sourceGenerate polymorphic URL in Rails
In this example, I want to explain a best practice for Polymorphic URLs in Rails. I will show really bad things here as an illustrative example. Don’t worry, we will refactor the code later Let us assume that we have three models, Post, News and Comment. In most cases, a post has many comments […]
Projekt Euler – probem 4 in Ruby
Let’s go on with part four of our mathematical soultions-series in Project Euler: Problem: The Largest palindrome product A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99. Find the largest palindrome made from the product of two 3-digit numbers. […]
Read more at the sourceActiveAdmin with http authentication
Ever asked yourself how to use HTTP Basic authentication with ActiveAdmin? There are several reasons to use HTTP Basic authentication for your backend. I needed a solution which can be recycled wherever I need a HTTP Basic authentication. I only wanted a central place for User and Password and I wanted just one call wherever […]
Read more at the sourceWhy the Rails default_scope is a bad thing
Activerecord provides default_scope to set a default scope for all operations on the model. I was never a friend of using default_scope, even when many friends used it in their projects. At the first look, it looks convenient but will lead to a headache very soon. We should avoid using it and here is why: […]
Read more at the source