
Recent Posts - page 2
-
Books 2018
-
Shall I guess?
In the last years, I’ve refrained from giving my opinion about many issues I don’t know enough or whenever I can not do much about it. Not only didn’t I share my views with others, but I avoided to spend… Read More ›
-
Deep Learning Introduction
Nowadays I’ve been mostly coding in ruby at work and in my free time at agreelist.org, but I’m learning deep learning by means of Andrew Ng’s Coursera specialization and I love it. Basically, a neural network (NN) is a box (function)… Read More ›
-
Wikidata queries
-
redirect_back in Rails 5
redirect_back in Rails 5 is handy: redirect_back(fallback_location: whatever_path) fallback_location is used when HTTP_REFERER is not present. In Rails 4 we had to use redirect_to :back and rescue RedirectBackError: class MyController < ApplicationController rescue_from ActionController::RedirectBackError, with: :redirect_to_default def action redirect_to :back end… Read More ›
-
My first post in Medium
I wrote a post in Medium about AgreeList.com and why I think it matters. You can also find the code of AgreeList on GitHub.
-
Rails 5 tutorial: How to create a Chat with Action Cable
David Heinemeier Hansson recorded a screencast building a chat with Action Cable in Rails 5. Here we have a summary: # app/controllers/rooms_controller.rb # app/views/rooms/show.html.erb # app/view/messages/_message.html.erb rails g channel room speak # app/channels/room_channel.rb And on app/assets/javascripts/cable.coffee we add: # app/assets/javascripts/channels/room.coffee… Read More ›
-
Template Method Pattern
The Template Method Pattern consists of a method that is used as a default value. It is then overwritten in classes that inherit or include it: This way classes that inherit from Cycle can overwrite default_chain, removing the need of super… Read More ›
-
Tools for regular expressions
Some interesting sites: http://regexr.com https://regex101.com/r/eB5jY1/1 https://www.debuggex.com/r/mci3WLNmHGTEatf6
-
Avoid the need for comments
As comments are not executable, they are easily out of date. They are a form of decaying documentation. If the code inside a method needs a comment, you probably can extract the code into a new method whose name explains what… Read More ›
Featured Categories
Inspiring ideas ›
-
Globalism
May 19, 2020
-
Decision Making in a Crisis
April 2, 2020
AI ›
-
Deep Learning Introduction
September 16, 2017
Ruby on Rails & other tech ›
-
Wikidata queries
June 12, 2016
-
redirect_back in Rails 5
March 25, 2016