Skip to content

Instantly share code, notes, and snippets.

View guillaumecabanel's full-sized avatar
🦄

Guillaume CABANEL guillaumecabanel

🦄
View GitHub Profile
@guillaumecabanel
guillaumecabanel / js_recap.md
Last active February 14, 2023 12:52
js recap

DOM & Events: recap

How to get one element from the dom

generic with css selector

<div class="title">Hello</div>

Fixing Webpacker 3.3.0 + Rails 5.1.5

Heroku hosting trouble

Heroku may not detect a correct buildpack for your JS dependencies, then you have to set it manually:

heroku buildpacks:add heroku/nodejs -i 1
heroku buildpacks:add --index 2 https://github.com/heroku/heroku-buildpack-ruby

Rules

  1. No commits/pushes to master 🚫
  2. Every feature (or every fix, anything new from master) is a new branch
  3. Never re-use branches

Recommendations

  1. Commit often (every time you’re happy/your code working). Remember, commits are “saves” or “snapshots” of your local code, something for you to rollback to if something breaks and also to track your own progress!
  2. Don’t understimate the power of PR interface on Github. Describe your changes, read code, ask questions, ask for corrections before you merge!

GIT CHECKLIST

Plugging a Datepicker

Let's put an end to datepicker suffering! Follow this steps to have your shiny new datepicker working in no time! (and remind yourselves of JS plugins in Rails)

Note: We recommend using Bootstrap Datepicker (try your own luck with anything different and remember, jQuery-UI's datepicker sucks, don't use it). These are the only three links you need:

  1. Docs
  2. Demo. Where you can play with different settings.