Use these rapid keyboard shortcuts to control the GitHub Atom text editor on macOS.
- ⌘ : Command key
- ⌃ : Control key
- ⌫ : Delete key
- ← : Left arrow key
- → : Right arrow key
- ↑ : Up arrow key
Use these rapid keyboard shortcuts to control the GitHub Atom text editor on macOS.
$(document).ready(function(){ | |
countdown(); | |
setInterval(countdown, 1000); | |
function countdown () { | |
var now = moment(), // get the current moment | |
// May 28, 2013 @ 12:00AM | |
then = moment([2013, 4, 28]), | |
// get the difference from now to then in ms | |
ms = then.diff(now, 'milliseconds', true); | |
// If you need years, uncomment this line and make sure you add it to the concatonated phrase |
By default, Rails applications build URLs based on the primary key -- the id
column from the database. Imagine we have a Person
model and associated controller. We have a person record for Bob Martin
that has id
number 6
. The URL for his show page would be:
/people/6
But, for aesthetic or SEO purposes, we want Bob's name in the URL. The last segment, the 6
here, is called the "slug". Let's look at a few ways to implement better slugs.