MySQLからの出力で改行を表示する(PHPで処理)
- これだと、改行が反映されない
<table> @foreach ($items as $items) <tr> <td>{{ $items['comment'] }}</td> </tr> @endforeach </table>
- 修正するとこんな感じになりました
<table> @foreach ($items as $items) <tr> <td> <pre>{{ $items['comment'] }}</pre> </td> </tr> @endforeach </table>
- preだとフォームみたいなのがついちゃうので、以下のスタイルを当てる
pre {border: 0; background-color: transparent;}
まとめ
- preタグを使って整形済みテキストとして表示するとよい
追記
こっちの方が現実的なので追記。
azix.hatenablog.com
MySQLのReInstall
HomeBrewで入れたMySQLのrootパスワードを忘れたので入れ直すことにした……
コマンドリスト1〜順に実行していく
brew remove mysql
brew cleanup
~/Library/LaunchAgents/com.mysql.mysqld.plist
の有無を確認- 3.があった場合 remove する
sudo rm -rf /usr/local/var/mysql
brew install mysql
unset TMPDIR
(TMPDIR環境変数の解除)mkdir -p ~/Library/LaunchAgents
cp /usr/local/Cellar/mysql/5.7.22/homebrew.mxcl.mysql.plist ~/Library/LaunchAgents/
(パスのバージョンはinstallした時に表示されたものを指定すること)launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
mysql_secure_installation
(セキュリティ関連セットアップ)--> YES/NO形式で答えていく- 設定ファイルによる設定(my.cnf)
6.のinstall結果は以下のようになる(現在の最新は5.7.22)
$ brew install mysql ==> Installing dependencies for mysql: openssl ==> Installing mysql dependency: openssl ==> Downloading https://homebrew.bintray.com/bottles/openssl-1.0.2o_1.high_sierra.bottle.tar.gz ######################################################################## 100.0% ==> Pouring openssl-1.0.2o_1.high_sierra.bottle.tar.gz ==> Caveats A CA file has been bootstrapped using certificates from the SystemRoots keychain. To add additional certificates (e.g. the certificates added in the System keychain), place .pem files in /usr/local/etc/openssl/certs and run /usr/local/opt/openssl/bin/c_rehash This formula is keg-only, which means it was not symlinked into /usr/local, because Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries. If you need to have this software first in your PATH run: echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.bash_profile For compilers to find this software you may need to set: LDFLAGS: -L/usr/local/opt/openssl/lib CPPFLAGS: -I/usr/local/opt/openssl/include ==> Summary 🍺 /usr/local/Cellar/openssl/1.0.2o_1: 1,791 files, 12.3MB ==> Installing mysql ==> Downloading https://homebrew.bintray.com/bottles/mysql-5.7.22.high_sierra.bottle.tar.gz ######################################################################## 100.0% ==> Pouring mysql-5.7.22.high_sierra.bottle.tar.gz ==> /usr/local/Cellar/mysql/5.7.22/bin/mysqld --initialize-insecure --user=asahinakamura --basedir=/usr/local/Cellar/mysql/5.7.22 --datadir=/usr/local/var/mysql --tmpdir=/tmp ==> Caveats We've installed your MySQL database without a root password. To secure it run: mysql_secure_installation MySQL is configured to only allow connections from localhost by default To connect run: mysql -uroot To have launchd start mysql now and restart at login: brew services start mysql Or, if you don't want/need a background service you can just run: mysql.server start ==> Summary 🍺 /usr/local/Cellar/mysql/5.7.22: 317 files, 234.2MB
12.設定ファイルは左から順に読み込まれる
$ mysql --help | grep my.cnf order of preference, my.cnf, $MYSQL_TCP_PORT, /etc/my.cnf /etc/mysql/my.cnf /usr/local/etc/my.cnf ~/.my.cnf
▷一つずつみていくと /usr/local/etc/my.cnf
だけファイルが有ったのでこれに以下の設定を追記
# デフォルトの文字コード character-set-server = utf8 # ユーザーのパスワードの有効期限(0:無効) default_password_lifetime = 0
▷default_password_lifetimeを無効にするのは、MySQL5.7からユーザパスワードの有効期限がデフォルトで360日になったために360日を過ぎてログインできなくなるのを防ぐための処置です
最後に
起動の確認。
$ mysql -u root -p
以上です。
2018年4月7日の「もくもく会」作業目標と成果
state:coinspace 神南
date:2018年4月7日 10:00 - 19:00
member:@akome_hero @necomeshi @andesm @zerokfy @akarui_1206 @grwth1009 @anya_an1
目的
- android studioを使ってみたい
- dockerを使ってみたい
目標
- android studioのインストールと日本語化
- android appでhello world! @エミュレーター
- dockerのインストールと起動
- 作成したandroid appをdocker上でbuild&エミュレーターで動かす
成果
- [Clear]android studioのインストールと日本語化
- [Clear]android appでhello world! @エミュレーター
- [Clear]dockerのインストールと起動
- [Unclear]作成したandroid appをdocker上でbuild&エミュレーターで動かす
docker install
-
stable版をインストール
docker start
で起動
-
VMを作成する
$ docker-machine create --driver virtualbox default Running pre-create checks... Error with pre-create check: "VBoxManage not found. Make sure VirtualBox is installed and VBoxManage is in the path"
って言って怒られる。docker for macではHyperKitがいるからVirtualBoxはいらないという話では…?
HyperKitがいるかどうか確認してみましたが普通にいました。
$ HyperKit -v HyperKit: v0.20171204-60-g0e5b6b Homepage: https://github.com/docker/hyperkit License: BSD
そもそもコマンドで virtualbox
とか指定しているから悪いんじゃ?
▷これ以上解決せず終了。っていうかコンテナさえ作ってしまえばいいんじゃ……とウダウダした後に気づいた。
dockerの公式ドキュメント読み込みます。
- containerを作成
作ったはずのContainerが表示されない〜と思ったけど —all
が必要でした
これだと出てこない
$ docker container ls CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
—allをつけることですべてのコンテナが表示される
$ docker container ls --all CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 9d0f29b83ef5 hello-world "/hello" 33 minutes ago Exited (0) 33 minutes ago angry_visvesvaraya 687d0ecb0013 nginx "nginx -g 'daemon of…" About an hour ago Exited (255) About an hour ago 0.0.0.0:80->80/tcp optimistic_dubinsky
※dockerコマンドは@curseoffさんの投稿を参考にしました Dockerコマンドメモ
android studio
Android Studio Android の公式 IDE Pleiades - Eclipse プラグイン日本語化プラグイン
- 3.0をインストール
- pleiadesをダウンロード
- 新規プロジェクト作成
- 最初からhello worldが入っていた
- エミュレーターからの実行
- エミュレーター起動→待受→アプリアイコン→アプリ起動→hello world確認
- どこでhello worldが定義されているのか
- 上記を踏まえ、ボタン押して画面遷移するようなhelloworldアプリを作成した
- 入力を遷移先で出力するようなもの
- githubとの連携
- ログイン
- 既存リポジトリへのcommit
- android studio上では出来たよ!ってメッセージが出ているけど、github.comではcontributionが表示されてないのでうまく言っていないみたい……→あとで調査必要(どこにcommitしたのよわたしは……)
▼成果物 - とりあえず動いたのには満足(1.8倍速)
お昼にまとめたこと(11:45~14:35はもくもくを抜けていました)
- 転職理由と志望理由
- お金がないよ
- 開発したいよ
- 上流工程もやってみたいよ
- 職務経歴書をまともな感じに書き直すよ
- マルチタスクエンジニアとしてやってきたよ
- 強みとやりたいこと・やれること
- なんでもサクサク人並みに覚えてやれるよ
- フロントエンドが強いよ
- サーバーサイドでわちゃわちゃできるようになりたいよ
- 作ったサービスが有るよ←これからだね。
★後日きちんとした経歴書を作ることになりました。