Skip to content

Instantly share code, notes, and snippets.

@TJXStyles
TJXStyles / gist:3c6e929b0ef91406d2720c5bdd3bddaf
Created November 20, 2017 17:47
javascript helper to convert cents into dollar. e.g: 1724 will make it $17.24
function formatPrice(cents) {
return `$${(cents / 100).toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g, ',')}`;
}
# Per-category pagination. Useful for multilingual blogs =)
# It will react, regarding your configuration in `config.yml`:
#
# paginate_per_category: true|false - activate this pagination or keep the
# default one
# default_category: "en" - determine the default category if you
# wish the root pagination to be this one
module Jekyll
module Generators
class Pagination < Generator
class Hangman
LIST = ["canada"]#, "england", "australia", "japan"]
attr_accessor :word, :chances, :board, :list, :guesses, :answer
class InvalidGuessException < Exception
end
def initialize()
@chances = 8
@guesses = []