brew updateしたら/usr/local/Library/brew.sh: line 32: /usr/local/Library/ENV/scm/git: No such file or directoryと怒られる問題

brew update

brew update したら

$  brew update                       
/usr/local/Library/brew.sh: line 32: /usr/local/Library/ENV/scm/git: No such file or directory
/usr/local/Library/brew.sh: line 32: /usr/local/Library/ENV/scm/git: No such file or directory
/usr/local/Library/brew.sh: line 32: /usr/local/Library/ENV/scm/git: No such file or directory
/usr/local/Library/brew.sh: line 32: /usr/local/Library/ENV/scm/git: No such file or directory
/usr/local/Library/brew.sh: line 32: /usr/local/Library/ENV/scm/git: No such file or directory
/usr/local/Library/brew.sh: line 32: /usr/local/Library/ENV/scm/git: No such file or directory
/usr/local/Library/brew.sh: line 32: /usr/local/Library/ENV/scm/git: No such file or directory
/usr/local/Library/brew.sh: line 32: /usr/local/Library/ENV/scm/git: No such file or directory
/usr/local/Library/brew.sh: line 32: /usr/local/Library/ENV/scm/git: No such file or directory
/usr/local/Library/brew.sh: line 32: /usr/local/Library/ENV/scm/git: No such file or directory
/usr/local/Library/brew.sh: line 32: /usr/local/Library/ENV/scm/git: No such file or directory
/usr/local/Library/brew.sh: line 32: /usr/local/Library/ENV/scm/git: No such file or directory
/usr/local/Library/brew.sh: line 32: /usr/local/Library/ENV/scm/git: No such file or directory
/usr/local/Library/brew.sh: line 32: /usr/local/Library/ENV/scm/git: No such file or directory
/usr/local/Library/brew.sh: line 32: /usr/local/Library/ENV/scm/git: No such file or directory
/usr/local/Library/brew.sh: line 32: /usr/local/Library/ENV/scm/git: No such file or directory
/usr/local/Library/brew.sh: line 32: /usr/local/Library/ENV/scm/git: No such file or directory
==> Homebrew has enabled anonymous aggregate user behaviour analytics.
Read the analytics documentation (and how to opt-out) here:
  http://docs.brew.sh/Analytics.html

Error: update-report should not be called directly!

めっちゃ怒られた

対応

他の方のブログでは brew prune で解消らしいが…

3回目の brew update で普通にupdateされました

なんだったのだろう…

getCurrentPosition() and watchPosition() no longer work on insecure origins. To use this feature, you should consider switching your application to a secure origin, such as HTTPS. See https://goo.gl/rStTGz for more details.

GoogleMapAPIを使って現在地情報を取得しようとしたところ Chrome

getCurrentPosition() and watchPosition() no longer work on insecure origins. To use this feature, you should consider switching your application to a secure origin, such as HTTPS. See https://goo.gl/rStTGz for more details.

Safari

[blocked] Access to geolocation was blocked over insecure connection to http://xxx.com.

とのエラーが…

GoogleMapAPIからの返り値を見ると下記のエラー文

getCurrentPosition() and watchPosition() no longer work on insecure origins. To use this feature, you should consider switching your application to a secure origin, such as HTTPS. See https://goo.gl/rStTGz for more details.

原因としては、 セキュリティの関係上SSLになっているか、ドメインlocalhostなど限られた条件でないと現在地情報を使えないようになっているようです。
ローカル環境で開発しているならドメインlocalhostに設定してデバッグすれば動作します。
もしくはFirefoxならドメイン関係なく現在地情報を使えるため問題なくデバッグできました。

All in One SEO Packでアーカイブページなどの個別ページにもtitle,descriptionを設定する

All in One SEO Packがアーカイブページにディスクリプションやらのメタタグを出力してくれないなと思ったらどうやらそういう仕様らしい

以下のサイトを参考にさせていただきました。 blog.maromaro.co.jp

追加で設定するためにfunction.php以下を書き足してフィルターを噛ませます。

<?php
function aioseop_title_extention($title){
  if(is_archive()){
    $title = 'タイトル'
  }
  return $title;
}
add_filter('aioseop_title', 'aioseop_title_extention');
?>

特定のカスタム投稿タイプのアーカイブページでのみ適用

自分の場合カスタム投稿のアーカイブページで書き換えたかったので以下のように変更

<?php
function aioseop_title_extention($title){
  if(is_post_type_archive('custom_post')){
    $title = 'タイトル';
  }
  return $title;
}
add_filter('aioseop_title', 'aioseop_title_extention');
?>

管理画面からメタタグを編集できるように拡張

タイトルを管理画面から編集できるようにしたかったので
カスタム投稿タイプと同じslug名の固定ページを作って
そこのAIOSEOの情報を引っ張ってくるように書き換えました。

<?php
function aioseop_title_extention($title){
  if(is_post_type_archive('custom_post')){
    $title = get_post_meta(get_page_by_path('custom_post')->ID, _aioseop_title, true);
  }
  return $title;
}
add_filter('aioseop_title', 'aioseop_title_extention');
?>

CSSで高さを可変にして縦横比(アスペクト比)を維持する

CSSで高さを可変にして縦横比(アスペクト比)を維持する方法です。
縦横比(アスペクト比)1:1のサイズで幅に合わせて高さを可変にしたい時などに使えます。 paddingの特性を使って実現しています。さっそく使い方から。

CSSで高さを可変にして縦横比(アスペクト比)を維持する方法

まずはhtmlから

<div class="box">
  <div class="box__content">
    text text
  </div>
</div>

cssはこう

.box {
  height: auto;
  position: relative;
  width: 100%;
}

.box::before {
  content: '';
  display: block;
  padding-top: 100%;
}

.box__content {
  bottom: 0;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

CSSで高さを可変にして縦横比(アスペクト比)を維持する方法の解説

キーになるのは beforepadding です。
paddingは%(パーセント)で指定した場合、親要素のwidthを基準に計算されます。
これを利用することで上記サンプルの padding-top の値を調整することでアスペクト比を指定して高さ可変のブロックを作ることができます。 https://www.w3.org/TR/CSS2/box.html#padding-properties

余談

アスペクト比とは

ウィキペディア様によると

アスペクト比アスペクトひ、 英語: aspect ratio)は、矩形における長辺と短辺の比率 長辺:短辺(横縦比)または短辺:長辺(縦横比)で表されるが、ここでは長辺:短辺で統一する。なお、テレビやデジタルビデオ関係では長辺:短辺(横縦比)で表されることが多いが、映画界では伝統的に短辺:長辺(縦横比)で表されることが多い。

とのこと
縦横比だけじゃなくて横縦比もあるらしい。
テレビも映画も業界似たようなものだと思うんですけどね…
なんでアスペクト比の認識が違うんだろう?

Your Gemfile has no gem server sources. If you need gems that are not already on your machine, add a line like this to your Gemfile:

Your Gemfile has no gem server sources. If you need gems that are not already on your machine, add a line like this to your Gemfile:
source 'https://rubygems.org'

と怒られた時の対処法

英文読めば分かるですが自分が読まずに調べてしまったので…

Gemfileの先頭に以下を追加すればOK

source 'https://rubygems.org'