uoz 作業日記

様々な作業の記録を共有するブログです。

TeXstudio のコマンド欄 macとwindowsでtex原稿を共有する設定メモ

もともとsjisでスタイルファイルもsjisの原稿があって、windowsmacで共有しないといけなかった。

TeXStudioの設定 > コマンド の欄

UTF-8の場合

platex -synctex=1 -interaction=nonstopmode %.tex

ただし、スタイルファイルもサクラエディタUTF-8に変換した

SJISの場合

platex tex –kanji=sjis -synctex=1 -interaction=nonstopmode %.tex

usb type-c の 電源ケーブル予備をかったよ | mac book pro 2016 touch bar

前のmacbook pro 15インチ(mid 2015)が壊れたから、新しいmacbook proを買ったよ。

13インチタッチバー付きで、SSD256GBのやつ。
それにともなっていろいろ買い物をしたので、久しぶりにアフィ記事を書く。

秋葉原のヨドバシに行ったら売り切れてて、1週間くらい待つという話だったので、ソフマップに行ったら普通に在庫があった。
仕事のためすぐ欲しかったのでそれを買った。

前は家用と持ち運び用で、電源のアダプタを2つ使っていたんだけど、
新しいmacbook proは端子がUSB type-cに統一されてしまったので、
予備用のACアダプタを買い直した。

続きを読む

kuroko2つかおう

手順

rails new my_kuroko2 --database=mysql --skip-turbolinks --skip-javascript -m https://raw.githubusercontent.com/cookpad/kuroko2/master/app_template.rb

このテンプレートのままだとなんか失敗

手動で

bundle install 

これも失敗

Bundler could not find compatible versions for gem "rails":
  In Gemfile:
    rails (= 4.2.6)

    kuroko2 was resolved to 0.2.0, which depends on
      rails (>= 5.0.0.1)

gemfileを編集してrailsを5にした

$ bundle exec rake db:create
$  bundle exec rake db:migrate

動かすにはforemanってのが必要らしい

$ gem install foreman

その後、

$ foreman start

動かねえ

template.rbが途中でコケてるせいて、koruko2のマイグレーションが実行されてないせいだ
https://raw.githubusercontent.com/cookpad/kuroko2/master/app_template.rb
を見て、

$ bundle exec rake 'kuroko2:install:migrations’
$ bundle exec rake db:migrate
$ foreman start

略  .rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/thor-0.19.3/lib/thor/base.rb:534:in `thor_reserved_word?': "run" is a Thor reserved word and cannot be defined as command (RuntimeError)

こんな感じで動かない

Gemfileにforemanいれてbundle execで動かしてみる

$ bundle exec foreman start

やっと立ち上がった

lcalhost:5000
がディフォルト

使ってみよう

Intellij Ideaでcakehp3のphpunitを動かす

webstormとかphpstormとか全部一緒だと思う。

下のstackoverflowに書いてあるやつの翻訳です.

1. Intellij の設定画面を開く

2. Languages & Frameworks > PHP を開く

3. Interpreter: でphpの実行ファイルを選ぶ
例えばosxMAMPだと
/Applications/MAMP/bin/php/php5.6.25/bin/php
とか

4. PHPUnitを選ぶ

5. PHPUnit Library 欄で、User Composer autoloaderを選んで、下の「Path to script」の右の欄にアプリディレクトリ内 vendor/autoload.phpへのパスを入れる

6. Test Runner 欄 で、「 Default configuration file」にチェックし、右のボックスに phpunit.xml.distのパスを入れる

!全部のパスは絶対パス


How to configure PhpStorm 10.x to run unit tests in CakePHP 3.x? - Stack Overflow

Without trying to solve your specific error, here's how I have configured PhpStorm.

In Languages & Frameworks > PHP

> Interpreter: Pointing to a local PHP executable
> PHPUnit > PHPUnit Library: Checked Use custom autoloader, pointing to vendor/autoload.php in the app folder.
> PHPUnit > Test Runner: Checked Default configuration file, pointing to phpunit.xml.dist in the app folder.

All paths should be absolute ones!

And that's all, running tests via the file/folder/code context menus Run ... command works just fine.

docker on mac を intelij から使いたい

blog.dekstroza.io


unixドメインソケットをtcpソケットとして使うためにsocatを使うという手法
qiita.com


homebrewでsocatをインストール

  $ brew install socat

その後socatを起動

  $ socat -d -d TCP-L:8099,fork UNIX:/var/run/docker.sock

intelijのdockerプラグインの設定開いて、
api URLに
tcp://localhost:8099
をいれる

OSXで使えるpostgresqlのGUIクライアント

f:id:uoz:20160815122511j:plain

最近使っている3種類の比較です。


ssh経由の接続などは皆できる。

pg commander

PG Commander, a PostgreSQL client for Mac

f:id:uoz:20160815223508j:plain

良い点

  • 無料板あり
  • テーブル構造が見られる

悪い点

  • インポート機能がない
  • テーブル構造が変えられない(2016-08-14時点)
  • フル機能版は¥5,800

psquel

http://www.psequel.com/
mysqlの有名クライアント、sequel proに影響を受けたクライアントソフト。

良い点

  • 完全無料
  • テーブル構造が見られる

悪い点

  • インポート機能がない
  • テーブル構造が変えられない(2016-08-14時点)

その他解説記事

postpico

Postico – a modern PostgreSQL client for the Mac

f:id:uoz:20160815223833j:plain

良い点

  • CSV等インポート機能有り
  • 無料版有り

悪い点

  • フル機能版は有料¥4,800