網路上的window.speechSynthesis教學主要都只有說切換指定語言
像是這樣就能切換成中文語音:
const synth = window.speechSynthesis;
const speak = (msg) => {| Adding Bootstrap to Rails 7 | |
| Reference: https://www.linkedin.com/pulse/rails-7-bootstrap-52-importmap-md-habibur-rahman-habib/ | |
| INSTRUCTIONS | |
| 1. Add the following to Gemfile: | |
| gem "bootstrap" | |
| gem "sassc-rails" |
| var langList = document.getElementById('langList'); | |
| if ('speechSynthesis' in window) { | |
| // Start an html table for languages details | |
| var text = '<table border=1><tr><th>Default<th>Language<th>Local<th>Name<th>URI</tr>'; | |
| // Get voices; add to table markup | |
| function loadVoices() { | |
| var voices = speechSynthesis.getVoices(); | |
| voices.forEach(function(voice, i) { | |
| // Add all details to table |
| # `ERROR: Error installing nokogiri: | |
| # ERROR: Failed to build gem native extension. | |
| # | |
| # current directory: /usr/local/var/rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/nokogiri-1.7.0/ext/nokogiri | |
| # /usr/local/var/rbenv/versions/2.3.1/bin/ruby -r ./siteconf20170103-68488-r71c9j.rb extconf.rb --with-xml=/usr/local/Cellar/libxml2/ --use-system-libraries | |
| # checking if the C compiler accepts ... yes | |
| # checking if the C compiler accepts -Wno-error=unused-command-line-argument-hard-error-in-future... no | |
| # Building nokogiri using system libraries. | |
| # ERROR: cannot discover where libxml2 is located on your system. please make sure `pkg-config` is installed. | |
| # *** extconf.rb failed *** |
This fast tutorial will teach you how to install redis-clion AWS EC2 without having to install the whole Redis Server. Firstly, SSH into your EC2 instance and run the following command:
$ sudo yum install gcc
This may return an "already installed" message, but that's OK. After that, just run:
$ wget http://download.redis.io/redis-stable.tar.gz && tar xvzf redis-stable.tar.gz && cd redis-stable && make && sudo cp src/redis-cli /usr/local/bin/ && sudo chmod 755 /usr/local/bin/redis-cli
| # Redis Cheatsheet | |
| # All the commands you need to know | |
| redis-server /path/redis.conf # start redis with the related configuration file | |
| redis-cli # opens a redis prompt | |
| # Strings. |
| ### | |
| FROM mhart/alpine-node | |
| RUN npm install -g http-server | |
| WORKDIR /site | |
| ADD ./ /site | |
| # The default port of the application |
Since Twitter doesn't have an edit button, it's a suitable host for JavaScript modules.
Source tweet: https://twitter.com/rauchg/status/712799807073419264
const leftPad = await requireFromTwitter('712799807073419264');| # Swift syntax highlighting for Vim | |
| # Source: http://wingsquare.com/blog/swift-script-syntax-highlighting-and-indentation-for-vim-text-editor/ | |
| echo "--- Installing and configuring Pathogen.." | |
| mkdir -p ~/.vim/autoload ~/.vim/bundle | |
| curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim | |
| echo "execute pathogen#infect() | |
| syntax on |