うちのいぬ Tech Blog

Tech Blog of Uchinoinu/My dog

うちのいぬ - うみちゃんと話せるbotを作りました 4 - とりあえずまとめ

これまでに書いたもの http://satomi.hatenablog.jp/entry/2016/06/26/104827satomi.hatenablog.jp http://satomi.hatenablog.jp/entry/2016/06/26/093734satomi.hatenablog.jp http://satomi.hatenablog.jp/entry/2016/06/25/213801satomi.hatenablog.jp 作…

うちのいぬ - うみちゃんと話せるbotを作りました 3 - LINE bot を Heroku と Rails を使って作ってみた

これまでFacebook botを作った経緯や作り方を書きました。 http://satomi.hatenablog.jp/entry/2016/06/26/093734satomi.hatenablog.jp http://satomi.hatenablog.jp/entry/2016/06/25/213801satomi.hatenablog.jp 今回は LINE bot の作り方を書きます https…

うちのいぬ - うみちゃんと話せるbotを作りました 2 - Facebook bot を Heroku と Rails を使って作ってみた

前回、概要と昨日までの成果物を書きました↓ http://satomi.hatenablog.jp/entry/2016/06/25/213801satomi.hatenablog.jp 今回はFacebook botをどう作ったか書きます。 環境 Heroku Ralis 4.2 Ruby 2.2 Uchinoinu - MyDogはbotだけじゃなくウェブサービスも…

うちのいぬ - うみちゃんと話せるbotを作りました 1

Uchinoinu - MyDog はこれまでTwitterでのうみちゃんの可愛いツイート垂れ流しbotしかサービスを持っていませんでしたが、 Facebookでうみちゃんと話せる機能が実装されました! とはいえ、まだオウム返しですがc(`Д´と⌒c)つ彡 実は、隠し機能としてtwitter…

The Copy Bundle Resources build phase contains this target's Info.plist file 'Info.plist'. のWarningのエラーが出た時の対処法

こんなWarning(警告)がでました The Copy Bundle Resources build phase contains this target's Info.plist file 'Info.plist'. 対応はこんな感じ build phase の Copy Bundle Resources から Info.plistを削除 参考 Technical Q&A QA1649: WARNING: The Co…

How to use new wercker to deploy to Heroku

日本語はこちら uchinoinu.hatenablog.jp What I want to do local --(git push origin master)--> bitbucket --> wercker --(passしたら)--> heroku Problems wercker is difficult to use for me Recently, wercker is really changeable. Free plan is wo…

Bitbucketで管理しているRailsプロジェクトを新しくなったWerckerを通じてHerokuにデプロイしてみた

English Version is here uchinoinu.hatenablog.jp やりたいこと Bitbucketにpushしたら、werckerが動いて、パスしたら、Herokuにデプロイされる local --(git push origin master)--> bitbucket --> wercker --(passしたら)--> heroku 問題 Werckerが変わり…

Xcode7.3でItunesConnectにUploadしようとしたらこんなエラーが出た際の対応: ERROR ITMS-90087: "Unsupported Architecture. Your executable contains unsupported architecture '[x86_64, i386]'."

Key Points 以下のことをやったらUpload出来た Linked Frameworks and Libraries に同名のframeworkが複数存在したので、それぞれ1つにした Navigatorのとこも同名のframeworkが複数存在したので整理した ただ↑以外にもCartfileをいじったりしていたので、こ…

ElCapitan/Xcode7.3 でcarthageを 0.9.3 -> 0.16.2 にアップデートした際のトラブル

Outline $ brew rm carthage $ brew install carthage でもこれじゃバージョンが変わらなかった。ので $ brew link --overwrite --dry-run carthage Would remove: /usr/local/bin/carthage $ brew link --overwrite carthage Linking /usr/local/Cellar/car…

In Rspec routing test code, add format to target url.

Memo require "rails_helper" RSpec.describe Api::V2::HogeController, type: :routing do describe "routing" do it "routes to #mine" do expect(:get => "/api/v2/hoges/mine").to route_to("api/v2/bookmarks#mine", format: "json") end . . .

Add pre-commit action before git commit to prevent me from getting in trouble.

初心者がAWSに手を出して$6,000請求されて、泣きそうになったお話 を読んで、わたしもきっとやるだろうなぁと思い、とりあえず自動でチェックしてもらうスクリプトだけでも入れておこうと思いました。 1. Git Templates $ git config --global init.template…

Macでbrew updateしたら、rails s すると以下のエラーが出るようになった時、 brew info と brew switchで乗り切る

この間 brew update したら ImageMagickのバージョンがあがってしまい、RMagickが動かなくなりました。 $ rails s => Booting Puma => Rails 4.2.0 application starting in development on http://localhost:3000 => Run `rails server -h` for more startu…

1.1 When I tried to run Android app by ReactNative, Error "failed to find Build Tools revision 23.0.1" has shown up

When I tried to run Android application implemented by React Native on Mac(Mavericks), errors below has shown up. $ react-native run-android JS server already running. Building and installing the app on the device (cd android && ./gradlew …

1. Getting Started

It takes really long to make applications (Android, iOS, Web), with their own language. The method is good to make better UI and performance. But in private time, there is not so much time!!! So, I choose cross-platform technology. Cordova…

Dog Loving Service!!!!

I love to use this in Japan.... And I want to commit this project if possible.... Wag! Get trusted, certified, dog walkers instantly when you need one. I want to make this world be dog-friendly.

When you want to use url with locale, OAuth using Devise & OmniAuth has error at callback. How to resolve?

Edit config/routes.rb, set only ominauth_callbacks outside of scope of locale. Rails.application.routes.draw do devise_for :users, skip: [ :session, :password, :registration, :confirmation ], controllers: { omniauth_callbacks: 'users/omnia…

how to input using hardware keyboard

iOS Uses Same Layout as OS X Connect Hardware Keyboard ⇧⌘K Toggle Software Keyboard ⌘K

Watch log without any thoughts... What I forgot when I add action to button of navigation

I tried to add button in navigation bar. I tried to add action to the button. But I forgot to set UIButton sender to argument of action method. This is my first experience to get trouble in this level. So I look back me so deeply. In Logs,…

Update rbenv and update ruby

Env MacOSX Yosemite Flow $ brew update $ brew upgrade ruby-build $ rbenv install -l # Check available versions $ rbenv install 2.2.3 # choose one from list above $ rbenv global 2.2.3 $ rbenv versions # Check result if you use bundler, you …

ワンコと一緒にいたいのでリモートワークしています

この記事は、リモートワーク Advent Calendar 2015 の12日目の記事です。 自己紹介 那覇〜浜松〜藤沢〜渋谷〜札幌 あたりをウロウロしている @satomi1_1 といいます。 ワンコと一緒に生活をするために札幌に引っ越してきました。 札幌では珍しいスタートアッ…

ワンコと一緒にいたいのでリモートワークしています

この記事は、リモートワーク Advent Calendar 2015 の12日目の記事です。 自己紹介 那覇〜浜松〜藤沢〜渋谷〜札幌 あたりをウロウロしている @satomi1_1 といいます。 ワンコと一緒に生活をするために札幌に引っ越してきました。 札幌では珍しいスタートアッ…

iOS でアプリを Background Mode で動かし、Background fetch をする

まず 次に func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { ・ ・ /* Background fetch */ UIApplication.sharedApplication().setMinimumBackgroundFetchInterval(UIApplic…

Migrationの書き方

Realm Swift0.95.0でAPIが色々変わったので、メモ。 ChangeLog realm-cocoa/CHANGELOG.md Migrationの書き方 func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { //↓↓↓↓ let co…

Swift, iOS References ( just a little aboutRails )

Web系エンジニア??が初めてiOSアプリをSwiftで開発してみて役に立ったなぁと思った記事のリンク集です。 自サーバーと連携するレコーディングアプリというかリファレンスアプリというか、を作りました。 バックエンドはRailsで作ったこともあり、そのとき…

StrongParameter でparameterに配列があるとき、その配列の中身をチェックする方法

paramsがこんな感じのとき { "foo": [ { "bar": "tar", "baz": "sar" }, { "bar": "tor", "baz": "sor" }, { "bar": "ter", "baz": "ser" }, { "bar": "tir", "baz": "sir" }, ] } StrongParametersで配列の中身を見る private def foo_params params.requir…

コードでの画面遷移で NavigationControllerを使ってもスライドアニメーションをさせない方法

あたりまでだけど、Segueとこんがらがったりしてなんか忘れていたので、メモ。 スライドアニメーションが出るコード var storyboard: UIStoryboard = UIStoryboard(name: "storyboardName", bundle: nil) var nextVC: UIViewController = storyboard.instant…

コードでの画面遷移で NavigationControllerを使ってもスライドアニメーションをさせない方法

あたりまでだけど、Segueとこんがらがったりしてなんか忘れていたので、メモ。 スライドアニメーションが出るコード var storyboard: UIStoryboard = UIStoryboard(name: "storyboardName", bundle: nil) var nextVC: UIViewController = storyboard.instant…

選択された Cell の背景色を変更

func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { var cell = tableView.dequeueReusableCellWithIdentifier("{cellIdentifier}", forIndexPath: indexPath) as! HogeCell // セルの背景色はな…

UIColorの使い方 - オリジナルのカラーに名前を付けて定義して使いたいとき

思いついた方法をメモります。 UIColorのextensionでも定数管理でもどちらでも出来ました。 ですがもっと適切な方法があるようにも思えます。 RGBを直接入力するとき UIColor(red:0.23,green:0.23,blue:0.23,alpha:1.0) UIColor(red: 3/255, green: 4/255, b…

TabBarでタップするTabItemがタップされたらなんかしらの処理を入れたいとき

TabBarControllerのCustom Classを設定 HogeViewControllerとします。 Tab Bar Item に Tag を設定 HogeViewControllerでTagの情報を取得して、処理を入れる 以下な感じでコードを追記します。 override func tabBar(tabBar: UITabBar, didSelectItem item: …