This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Pluralizations | |
# Uses English pluralization rules -- it will pick the first translation if count is not equal to 1 | |
# and the second translation if it is equal to 1. | |
class OneOther | |
def get_symbol(n) | |
n == 1 ? :one : :other | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input = [] | |
input << [500] | |
input << [100, 200] | |
input << [300, 400, 500] | |
input << [200, 200, 500, 900] | |
input << [900, 100, 200, 100, 101] | |
input << [100, 900, 100, 100, 100, 700] | |
# n = input.size |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// create a bookmark and use this code as the URL, you can now toggle the css on/off | |
// thanks+credit: https://dev.to/gajus/my-favorite-css-hack-32g3 | |
javascript: (function() { | |
var styleEl = document.getElementById('css-layout-hack'); | |
if (styleEl) { | |
styleEl.remove(); | |
return; | |
} | |
styleEl = document.createElement('style'); | |
styleEl.id = 'css-layout-hack'; |