Better HN
topnewbestaskshowjobs
Log inSign up

nicolasMLV

33 karma · joined Jan 9, 2015 (11y ago) · 17 submissions

twitter.com/nicolasmlv
Submissions

comment 8y ago · link · parent

Rails uses foreign keys by default, usually I generate a migration file with `rails generate migration AddThisToThing this:references`

Then this line is generated `add_reference :things, :this, foreign_key: true`

and then we call the migration, and there is the foreign key.

comment 8y ago · link · parent

It is mainly a wrapper around this chrome headless command : (maybe you only need that)

`#{chrome_alias} --headless --disable-gpu --print-to-pdf="#{pdf_path}" "#{html_url}"`

3.

Stimulus: A modest JavaScript framework that works with the HTML you already have(github.com ↗)

21 points · by nicolasMLV · 8y ago · discuss

comment 8y ago · link · parent

Turbolinks is the official Front-end part of Rails and it works very well, but there is no mention of it in the article neither in the hackernews comments, so i think it is under-used.

There's also turbolinks-ios and turbolinks-android, I built my mobile apps with minimal knowledge of Swift and Kotlin.

5.

Early stage VC backed by some of the world's best entrepreneurs(villageglobal.vc ↗)

1 points · by nicolasMLV · 9y ago · discuss

comment 9y ago · link · parent

David Heinemeier Hansson, CTO of Basecamp and Creator of Ruby on Rails https://www.twitter.com/dhh

comment 10y ago · link · parent

You could simplify this

  <script>
    var counter = 0;
    $(document).ready(function() {
      var $output = $('#output');  
      $('#increment').click(function() {
        counter++;
        $output.html(counter);
      });
      $output.html(counter);
    });
 </script>
with

  <script>
    var counter = 0;
    $(document).on('click', '#increment', function() {
        counter++;
        $('#output').html(counter);
    });
  </script>

comment 10y ago · link · parent

been using it for 1 year to swap keys (beer+keyboard accident...) and it works well

comment 10y ago · link · parent

In 2013 I declined an offer (first job, graduate): software dev in bigco (IT Provider travel industry), £38K

comment 10y ago · link · parent

yes, that is event delegation : https://learn.jquery.com/events/event-delegation/

comment 10y ago · link · parent

You can use event delegation for button handling : `$(document).on('click', '.button-list', my_function);`

https://learn.jquery.com/events/event-delegation/

12.

Why this pull request isn’t merged(github.com ↗)

3 points · by nicolasMLV · 10y ago · discuss

comment 10y ago · link · parent

Great but Turbolinks 5 and Action Cable (web sockets) are missing

comment 10y ago · link · parent

Let's hope Github will find a way for users to be able to 'tip' maintainers. I concede it is very hard to find the solution (Who? When? How much?)

comment 10y ago · link · parent

Here is a new blogpost from DHH "Provide sharp knives"

https://m.signalvnoise.com/provide-sharp-knives-cc0a22bf7934

comment 10y ago · link · parent

Just been removed from https://www.producthunt.com/upcoming although 20 upvotes

17.

News Feed is bad and Facebook should feel bad(nicolasmlv.com ↗)

1 points · by nicolasMLV · 11y ago · discuss