As easy as 1, 2, 3!
Updated:
- Aug, 08, 2022 update
config
docs for npm 8+ - Jul 27, 2021 add private scopes
- Jul 22, 2021 add dist tags
- Jun 20, 2021 update for
--access=public
- Sep 07, 2020 update docs for
npm version
/** | |
* Get a random floating point number between `min` and `max`. | |
* | |
* @param {number} min - min number | |
* @param {number} max - max number | |
* @return {number} a random floating point number | |
*/ | |
function getRandomFloat(min, max) { | |
return Math.random() * (max - min) + min; | |
} |
# modification of http://stackoverflow.com/questions/4136248/how-to-generate-a-human-readable-time-range-using-ruby-on-rails | |
def humanize_seconds secs, precision = 2 | |
return unless secs | |
units = [[60, :second], [60, :minute], [24, :hour], [1000, :day]] | |
diffs = units.map do |count, name| | |
next if units.find_index([count, name]) > precision | |
if secs > 0 | |
secs, n = secs.divmod(count) | |
pluralize(n.to_i, name.to_s) if n > 0 | |
end |
@mixin center($width, $height) { | |
position: absolute; | |
left: 50%; | |
top: 50%; | |
height: $height; | |
width: $width; | |
margin-left: - $width / 2; | |
margin-top: - $height / 2; | |
} |