フロントエンド:真っさらな Mac - Yosemite をゼロから環境構築する際の備忘録
ATOM
- ATOM オフィシャルから DL してインストール
- ATOM 用シェルコマンドを有効にする "Atom" -> "Install Shell Commands"
- 再起動必要?
- Proxy にひっかかる場合は、以下のコマンドを叩く
$ apm config set https-proxy http://example.com:8080/
iTerm
- iTerm 2 オフィシャルから DL してインストール
- 背景を透明にするとお洒落 "Preferences" -> "Profiles" -> "Window > Window Appearance"
Homebrew
- 以下のコマンドで Homebrew をインストール
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Proxy にひっかかる場合は以下を
$ export http_proxy=http://example.com:8080/
$ export https_proxy=$http_proxy
$ export all_proxy=$http_proxy
Git
- 以下のコマンドで Git をインストール
$ brew install git
デフォルトで非表示ファイルは表示されてないので、以下コマンドで表示
$ defaults write com.apple.finder AppleShowAllFiles TRUE
$ killall Finder
Proxy 問題がある場合、Git の色々なコマンドを叩いてもファイルが落ちない上がらないので以下設定を追加
$ git config --global http.proxy http://example.com:8080/
$ git config --global https.proxy http://example.com:8080/
Node
- Node.js オフィシャルからインストーラを DL してインストール
oh-my-zsh
- 便利なんで Oh My ZSH! もインストール
$ sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
Proxy 問題ある方は、手動でインストールも可
$ git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
$ cp ~/.zshrc ~/.zshrc.orig
$ cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
$ zsh
# 但し、手動でインストールすると自動アップデートが効かない。以下コマンドでアップデート
$ upgrade_oh_my_zsh
良さげな Oh My ZSH plugins を入れましょう
: ~/.zshrc
# plugins=(git)
plugins=(git sublime sudo web-search)
sublime / sudo / web-search
プラグイン一式は右記ディレクトリに ~./oh-my-zsh/plugins
必要なら theme(テーマ) も変更
: ~/.zshrc
# ZSH_THEME="robbyrussell"
デフォルトシェルを zsh に変更
$ chsh -s /bin/zsh
# zsh <-> bash の切り替えは
# zsh に切り替え
$ zsh
# bash に切り替え
$ bash
XAMPP
- オフィシャルから XAMPP のインストーラを DL してインストール
"/User/git/" ディレクトリのファイルを "http://git.hoge.com/" として表示させるには
: /etc/hosts
# 以下を追記
$yourHost$ git.hoge.com
: /Applications/XAMPP/xamppfiles/etc/httpd.conf
// 以下の部分を書き換え
# Virtual hosts
# Include etc/extra/httpd-vhosts.conf
↓
# Virtual hosts
Include etc/extra/httpd-vhosts.conf
: /Applications/XAMPP/xamppfiles/etc/extra/httpd-vhosts.conf
# 以下を追記 (SSI も有効に)
<VirtualHost *:80>
DocumentRoot "/Users/$yourUserName$/git"
DirectoryIndex index.php index.html
ServerName git.hoge.com
ErrorLog "/Applications/XAMPP/htdocs/error.log"
<Directory "/Users/$yourUserName$/git">
Options +Includes
AddOutputFilter INCLUDES .html
AddType text/html .shtml
Order deny,allow
Allow from ALL
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
非同期で json を呼ぶ場合
デフォルトだと json の MIME-Type が text/plain もしくは指定なしのケースがあるので、
/etc/mime.typesに、以下を追記、もしくは以下に修正。
application/json json