Skip to content

Instantly share code, notes, and snippets.

@sergiodxa
sergiodxa / human-readable-duration-format.js
Created September 10, 2018 21:07
Human readable duration format
const messages = {
year: { singular: 'year', plural: 'years', denominator: 365, inSeconds: 31536000 },
day: { singular: 'day', plural: 'days', denominator: 24, inSeconds: 86400 },
hour: { singular: 'hour', plural: 'hours', denominator: 60, inSeconds: 3600 },
minute: { singular: 'minute', plural: 'minutes', denominator: 60, inSeconds: 60 },
second: { singular: 'second', plural: 'seconds', inSeconds: 1 }
}
function pluralize(value, unit) {
if (value === 1) return messages[unit].singular;
PostgreSQL Type PostgreSQL Size Description Range Diesel Type Rust Type
Nullable Types nullable Nullable``
@suewonjp
suewonjp / Edit and review github wiki on your local machine.md
Last active February 11, 2023 22:35
Edit and review github wiki on your local machine
First, clone your github wiki to your local machine
  1. Checkout your repository wiki via git.
     - You can find the URL at the lower-right of your wiki page (look for the label "Clone this wiki locally")
  2. Now that you have pulled down a local copy of your github repo wiki, create a new file in the repo called _Sidebar.md  - Note that other names might not work.
  3. Within the newly created _Sidebar.md file, you can add appropriate [[link]] markdown syntax.
  4. Add your new file to the local repository, and push via git push origin master.

With the same procedure, you can add a header(_Header.md) and footer(_Footer.md) file.