10000hの技術メモ

この先生きのこるための勉強内容&時間記録

JavaScript基礎編 学習コース

20170521@home Progate | プログラミングの入門なら基礎から学べるProgate[プロゲート]

目次

  • JSの基本
    • JSに触れてみよう
    • JavaScriptの基本文法
  • 変数
    • 変数の基本
    • 変数の更新
    • 文字列の連結
  • 条件分岐
    • if文
    • else, else if
    • 論理演算子
  • 繰り返し処理
    • while
    • for
    • break, continue
  • 配列と連想配列
    • 配列
    • 配列と繰り返し
    • 連想配列
  • 関数
    • 関数の基本
    • 関数の自作
続きを読む

徹底マスター JavaScriptの教科書 第6章 Webブラウザでの入出力 6.3 イベントハンドラの登録とタイマー

JavaScriptの勉強をしています。

今回は6.3から。

続きを読む

徹底マスター JavaScriptの教科書 第6章 Webブラウザでの入出力 6.1 ダイアログ表示

JavaScriptの勉強をしています。

変数とは何か、的な章はさらっと読んで(もちろんJavaScriptの特徴などはそれなりにちゃんと読みつつ)、一部の章はちゃんと手を動かす作戦。

続きを読む

Electronではじめるアプリ開発 2-4 最初のアプリケーションを作成する

Electronを本で勉強。2-3はとばして2-4を。

Electronではじめるアプリ開発 ~JavaScript/HTML/CSSでデスクトップアプリを作ろう

Electronではじめるアプリ開発 ~JavaScript/HTML/CSSでデスクトップアプリを作ろう

続きを読む

Electronではじめるアプリ開発 2-2 アプリケーション作成の準備

Electronを本で勉強。今回は2-2を。

Electronではじめるアプリ開発 ~JavaScript/HTML/CSSでデスクトップアプリを作ろう

Electronではじめるアプリ開発 ~JavaScript/HTML/CSSでデスクトップアプリを作ろう

続きを読む

Electronではじめるアプリ開発 2-1 Node.jsをインストールする

Electronを本で勉強。

Electronではじめるアプリ開発 ~JavaScript/HTML/CSSでデスクトップアプリを作ろう

Electronではじめるアプリ開発 ~JavaScript/HTML/CSSでデスクトップアプリを作ろう

nodebrewのインストール

brew install nodebrew

出力結果

rrcs-172-254-99-29:~ yoshikiito$ brew install nodebrew
Error: /usr/local is not writable. You should change the ownership
and permissions of /usr/local back to your user account:
  sudo chown -R $(whoami) /usr/local
Warning: You are using OS X 10.12.
We do not provide support for this pre-release version.
You may encounter build failures or other breakages.
Please create pull-requests instead of filing issues.
==> Using the sandbox
==> Downloading https://github.com/hokaccha/nodebrew/archive/v0.9.6.tar.gz
==> Downloading from https://codeload.github.com/hokaccha/nodebrew/tar.gz/v0.9.6
######################################################################## 100.0%
==> /usr/local/Cellar/nodebrew/0.9.6/bin/nodebrew setup_dirs
==> Caveats
Add path:
  export PATH=$HOME/.nodebrew/current/bin:$PATH

To use Homebrew's directories rather than ~/.nodebrew add to your profile:
  export NODEBREW_ROOT=/usr/local/var/nodebrew

Bash completion has been installed to:
  /usr/local/etc/bash_completion.d

zsh completion has been installed to:
  /usr/local/share/zsh/site-functions
==> Summary
🍺  /usr/local/Cellar/nodebrew/0.9.6: 7 files, 36.8K, built in 3 seconds

Warningが出てる。若干不安だけども、続けて。セットアップ。

yoshikiito$ nodebrew setup
Fetching nodebrew...
Installed nodebrew in $HOME/.nodebrew

========================================
Export a path to nodebrew:

export PATH=$HOME/.nodebrew/current/bin:$PATH
========================================

.bash_profileの設定

yoshikiito$ echo 'export PATH=$HOME/.nodebrew/current/bin:$PATH' >> ~/.bash_profile
yoshikiito$ source ~/.bash_profile

nodebrew -versionで表示されることを確認。

yoshikiito$ nodebrew -version
nodebrew 0.9.6

Usage:
    nodebrew help                         Show this message
    nodebrew install <version>            Download and install <version> (compile from source)
    nodebrew install-binary <version>     Download and install <version> (binary file)
    nodebrew uninstall <version>          Uninstall <version>
    nodebrew use <version>                Use <version>
    nodebrew list                         List installed versions
    nodebrew ls                           Alias for `list`
    nodebrew ls-remote                    List remote versions
    nodebrew ls-all                       List remote and installed versions
    nodebrew alias <key> <value>          Set alias
    nodebrew unalias <key>                Remove alias
    nodebrew clean <version> | all        Remove source file
    nodebrew selfupdate                   Update nodebrew
    nodebrew migrate-package <version>    Install global NPM packages contained in <version> to current version
    nodebrew exec <version> -- <command>  Execute <command> using specified <version>

Example:
    # install from binary
    nodebrew install-binary v0.10.22

    # use a specific version number
    nodebrew use v0.10.22

    # io.js
    nodebrew install-binary io@v1.0.0
    nodebrew use io@v1.0.0

できたっぽい。

Node.jsのインストール

最新が出ているものの、本のバージョンにあわせてv6.10.0を選択してインストール。

yoshikiito$ nodebrew install-binary v6.10.0
Fetching: https://nodejs.org/dist/v6.10.0/node-v6.10.0-darwin-x64.tar.gz
######################################################################## 100.0%
Installed successfully

インストールしただけだと使えないので、nodebrew use バージョンするか、一つしか入れていないのでnodebrew use stableでも、nodebrew use latestでも結果は一緒っぽい。(ぽいばっかりだな・・・)

yoshikiito$ nodebrew use stable
use v6.10.0

ここまでやったら、node -vで確認。

yoshikiito$ node -v
v6.10.0

OK。

参考

Node.jsをMacにインストール!(Homebrew→Nodebrew→Node.js順にインストール) - モーリーのメモ

今回の勉強時間:22分 累計勉強時間:14時間33分

Ruby on Rails Ⅵ 3章 いいね!に関連する機能をつけよう - いいね!の数を表示しよう

20170322@home Progate | プログラミングの入門なら基礎から学べるProgate[プロゲート]

目次

※なぜか2章がレッスンに無い

いいね!の数を表示しよう

countメソッドを使う。

例えば

@user.likes.count

今回の勉強時間:4分 累計勉強時間:14時間11分