Wikidata queries

Let’s play with Wikidata (query.wikidata.org)

Return 20 items which are instance of human which have a twitter account:
SELECT ?item ?twitter
WHERE {
?item wdt:P31 wd:Q5 .
?item wdt:P2002 ?twitter .
} LIMIT 20

Screen Shot 2016-06-12 at 11.22.35

Or all Nobel Peace laureates:
Read the rest of this entry »


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

    private

    def redirect_to_default
      redirect_to root_path
    end
  end

		

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.


Tools for regular expressions

Some interesting sites:

http://regexr.com

https://regex101.com/r/eB5jY1/1

https://www.debuggex.com/r/mci3WLNmHGTEatf6