2014年9月アーカイブ

Middlemanで生成したサイトをAmazon S3で運用する

これは簡単そう。ドメインとS3URLの割り付けはDNSのレコードに設定するのね。
qnyp blogさんより。
Ruby2.0+ インストール (Centos6.5で実施)

1. 依存パッケージのインストール
epelリポジトリを入れておく(いくつかの依存パッケージが標準のリポジトリにないため)
# wget http://ftp.jaist.ac.jp/pub/Linux/Fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm

# rpm -ivh epel-release-6-8.noarch.rpm

2. 依存パッケージをインストール
# yum install gcc-c++ patch readline readline-devel
# yum install zlib zlib-devel libffi-devel
# yum install openssl-devel make bzip2 autoconf automake libtool bison
# yum install gdbm-devel tcl-devel tk-devel
# yum install libxslt-devel libxml2-devel
# yum install --enablerepo=epel libyaml-devel

3. rvmをインストール
以下のコマンドを叩く。
# curl -L https://get.rvm.io | bash -s stable

rvmのパスを設定するための記述が以下のファイルに追記されるので、確認しておく

# vim .bash_profile
# vim .bashrc

※vim終了は [esc][:][q]
 
再ログインしてbash_profileと.bashrcの変更をロードする。

rvmの確認

バージョン確認

# rvm -v

対応しているRubyの一覧

# rvm list known

4. ruby2.1.1をインストールする場合

# rvm install 2.1.1

バージョン確認

# ruby -v
ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-linux]

SNSボタン各種設置

| コメント(0)
Facebook いいねボタン
Twitterボタン 



実装する、こんな感じになります。









Facebookは、ボタンの下に空間が必要みたいですね。

ファビコン作成

| コメント(0)

OpenCV

| コメント(0)

Amazon Web Services: SNS

| コメント(0)

Amazon Web Services: SNS


AWS SNSを使うと比較的に簡単にプッシュ通知を実現できるんだけど、通知と同時に音をならしたり、バッジを設定しようとすると、JSON形式でメッセージを送る必要がある。
デフォルト音は以下の引用を参考にするとだせるが、あとは、バッジの数の設定例がまだよくわからない。

以下引用です。

JSON Publish 例

  1. {
  2. "default": "<enter your message here>",
  3. "email": "<enter your message here>",
  4. "sqs": "<enter your message here>",
  5. "http": "<enter your message here>",
  6. "https": "<enter your message here>",
  7. "sms": "<enter your message here>",
  8. "APNS": "{\"aps\":{\"alert\": \"<message>\",\"sound\":\"default\"} }",
  9. "APNS_SANDBOX": "{\"aps\":{\"alert\": \"<message>\",\"sound\":\"default\"} }",
  10. "GCM": "{ \"data\": { \"message\": \"<message>\" } }",
  11. "ADM": "{ \"data\": { \"message\": \"<message>\" } }"
  12. }

APNS だと sound が使える。

Lancorkさんから。http://www.lancork.net

追記(2014/11/04)
registerForRemoteNotificationTypes: is not supported in iOS 8.0 and later.

iOS8よりregisterForRemoteNotificationTypesが使えなくなった。
ターゲットがiOS7でも動作しないため、iOSのバージョンを判定した上で対応する必要あり。

    /* iOS8より、registerForRemoteNotificationTypesは、使えない。

    [[UIApplication sharedApplication]registerForRemoteNotificationTypes:

     (UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound)];

     return YES;

    */

    

    if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)

    {

        [[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]];

        [[UIApplication sharedApplication] registerForRemoteNotifications];

    }

    else

    {

        [[UIApplication sharedApplication] registerForRemoteNotificationTypes:

         (UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert)];

    }

    return YES;




http://dev-ipho.blogspot.jp/2013/02/iphone.html

「iPhoneアプリ開発 苦闘の道」さんより。
http://www.objectivec-iphone.com/foundation/NSString/intValue.html

逆引きObjective-C for iPhoneアプリさんから。
http://www.objectivec-iphone.com/foundation/NSString/rangeOfString.html


逆引きObjective-C for iPhoneアプリさんから。
http://www.objectivec-iphone.com/foundation/NSFileManager/fileExistsAtPath.html

逆引きObjective-C for iPhoneアプリさんから。


ビープ音とかバイブとか。
A Day In The Lifedさんから

このアーカイブについて

このページには、2014年9月に書かれた記事が新しい順に公開されています。

前のアーカイブは2014年8月です。

次のアーカイブは2014年10月です。

最近のコンテンツはインデックスページで見られます。過去に書かれたものはアーカイブのページで見られます。