エラー
1 | rake aborted! |
解決策
1 | # cdする先のディレクトリは人によって違う。下のコマンドで確認できる。 |
1 | rake aborted! |
1 | # cdする先のディレクトリは人によって違う。下のコマンドで確認できる。 |
googleの翻訳APIをrailsで実行する方法です。
APIキーを使えばjs側でも実行できますが、そうするとAPIキーがユーザーに漏れてしまうので、Railsなどのサーバーを経由するようにしましょう。
1 | async translate(text) { |
Gemfileに以下の行を追加する
1 | gem 'google-cloud-translate-v2' |
ターミナルで以下のコマンドを実行する
1 | bundle install |
APIキーを利用することもできるのですが、gemライブラリを利用する場合はAPIキーではなく認証情報を利用する方法が便利です。
routes.rb
1 | Rails.application.routes.draw do |
google_api
フォルダを作成するgoogle_api
フォルダにtranslation_controller.rbファイルを作成する1 | require 'google/cloud/translate/v2' |
1 | async setImageToInput(base64Image, inputElement) { |
1 | session not created: This version of ChromeDriver only supports Chrome version 94 |
ブラウザのバージョンを上げたので、合わせてchromeDriverのバージョンを上げないといけないっぽい
1 | brew upgrade chromeDriver |
Macにmitmproxyをインストール
1 | brew install mitmproxy |
MacとAndroidで同じWi-fiに接続する
MacのWi-fiのIPアドレスを確認する
リンゴマーク>システム設定>ネットワーク>Wi-fi>詳細>TCP/IP>IPアドレス
Macで監視アプリを起動
1 | mitmweb --web-port 10081 --listen-port 10080 |
Androidの設定>ネットワークとインターネット>対象のWi-fiの設定>プロキシを手動に変更する
Androidでhttp://mitm.it/
にアクセスする
Androidの証明書をダウンロードする
設定>セキュリティ>詳細設定>暗号化と認証情報>証明書のインストール>CA証明書 から証明書をインストールする
Macでhttp://127.0.0.1:10081
を開くとAndroidで通信した内容が表示される
Androidアプリを開発している場合はその設定も必要
AndroidManifest.xmlにnetworkSecurityConfigの行を追加する
1 | <application |
app/src/main/res/xml/network_security_config.xmlを作成する
1 | <network-security-config> |
参考
iOS 14 端末での mitmproxy 設定方法
AFNetworkingのリクエストでCookieを扱う方法
MITMProxy - Set up Android Devices
1 | before do |
いつもモックやスタブではallow(hoge).to receive(:fuga).and_return(piyo)
の書き方でやってたので、それがうまく効かなくてハマりました。。
以上です。
ZonedDateTime型のモックの作成方法
1 | import org.threeten.bp.ZonedDateTime |
以上
余談だが、最初は以下のような書き方をしようとして、
1 | every { user.contractedAt } returns ZonedDateTime.of(2022, 7, 13, 0, 0, 0, 0, ZoneId.of("Asia/Tokyo")); |
io.mockk.MockKException: no answer found for: ZoneId
のエラーが出て詰んだ。
Privacy Policy
reon777 built the Poker Action Counter app as a Freemium app. This SERVICE is provided by reon777 at no cost and is intended for use as is.
This page is used to inform visitors regarding my policies with the collection, use, and disclosure of Personal Information if anyone decided to use my Service.
If you choose to use my Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that I collect is used for providing and improving the Service. I will not use or share your information with anyone except as described in this Privacy Policy.
The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which are accessible at Poker Action Counter unless otherwise defined in this Privacy Policy.
Information Collection and Use
For a better experience, while using our Service, I may require you to provide us with certain personally identifiable information. The information that I request will be retained on your device and is not collected by me in any way.
The app does use third-party services that may collect information used to identify you.
Link to the privacy policy of third-party service providers used by the app
Log Data
I want to inform you that whenever you use my Service, in a case of an error in the app I collect data and information (through third-party products) on your phone called Log Data. This Log Data may include information such as your device Internet Protocol (“IP”) address, device name, operating system version, the configuration of the app when utilizing my Service, the time and date of your use of the Service, and other statistics.
Cookies
Cookies are files with a small amount of data that are commonly used as anonymous unique identifiers. These are sent to your browser from the websites that you visit and are stored on your device’s internal memory.
This Service does not use these “cookies” explicitly. However, the app may use third-party code and libraries that use “cookies” to collect information and improve their services. You have the option to either accept or refuse these cookies and know when a cookie is being sent to your device. If you choose to refuse our cookies, you may not be able to use some portions of this Service.
Service Providers
I may employ third-party companies and individuals due to the following reasons:
I want to inform users of this Service that these third parties have access to their Personal Information. The reason is to perform the tasks assigned to them on our behalf. However, they are obligated not to disclose or use the information for any other purpose.
Security
I value your trust in providing us your Personal Information, thus we are striving to use commercially acceptable means of protecting it. But remember that no method of transmission over the internet, or method of electronic storage is 100% secure and reliable, and I cannot guarantee its absolute security.
Links to Other Sites
This Service may contain links to other sites. If you click on a third-party link, you will be directed to that site. Note that these external sites are not operated by me. Therefore, I strongly advise you to review the Privacy Policy of these websites. I have no control over and assume no responsibility for the content, privacy policies, or practices of any third-party sites or services.
Children’s Privacy
These Services do not address anyone under the age of 13. I do not knowingly collect personally identifiable information from children under 13 years of age. In the case I discover that a child under 13 has provided me with personal information, I immediately delete this from our servers. If you are a parent or guardian and you are aware that your child has provided us with personal information, please contact me so that I will be able to do the necessary actions.
Changes to This Privacy Policy
I may update our Privacy Policy from time to time. Thus, you are advised to review this page periodically for any changes. I will notify you of any changes by posting the new Privacy Policy on this page.
This policy is effective as of 2022-06-21
Contact Us
If you have any questions or suggestions about my Privacy Policy, do not hesitate to contact me at r.saito1226+pac@gmail.com.
This privacy policy page was created at privacypolicytemplate.net and modified/generated by App Privacy Policy Generator
Androidのボタンに枠線を付ける方法です。
OutlinedButtonを使えば簡単なのですが、そこに気付かずにハマってしまいました。。
hoge.xml
1 | <com.google.android.material.button.MaterialButton |
styles.xml
1 | <style name="HogeButton" parent="Widget.Material3.Button.OutlinedButton"> |
Google Analyticsでメールの開封率を測定する方法です。
メールを開いた時に発生するイベントを仕込みます。
そのイベントの発生回数と、メール送信回数を使って開封率を算出します。
メールには通常のテキストとリッチテキストの2種類あります。
リッチテキストではhtmlが書けます。
今回はimgタグにイベントを仕込むので、リッチテキストを使います。
1 |
|
あとは通常通りにメール送信するだけです。
結果はanalyticsからいつも通り確認できます。
elの値でフィルタすると良いと思います。
以上です。
Update your browser to view this website correctly. Update my browser now