spモード | サービス・機能 | NTTドコモ
キャリアメール情報がなかなか見つから無かったんだけど、pdfに書いてあった。
http://www.nttdocomo.co.jp/binary/pdf/service/provider/spmode/guide/sp.pdf
新規申し込みの場合
spモードを新規にご契約されると、メールアドレスは「ランダムな英数字@docomo.ne.jp」となっています。……
iモードの解約と同時にお申込みの場合
iモードの解約と同時にspモードをお申込みいただいた場合は、今までお使いのメールアドレス・iモードパスワード・迷惑メール対策設定が自動的に引き継がれます。
iモードとspモードは排他。
ガラケーを二度と使わないならspモードへ、使うなら予定があるなら今まで通りiモード、iモード.net、mopera U契約でiMoNiを利用すればいい。
spモード変更時にiモードセンターに保存されている未受信メールは破棄される。
元のガラケーにSIMさして受信していない場合、iモードセンターにいっぱい貯まってると思いますが、iMoNiで受信しているので不要だと思います。
必要ならば、spモード契約前にガラケーにSIMさして受信しておくとよいと思います。
公開鍵を作成し設定する
Help.GitHub – Generating SSH keys (Win/msysgit)
ユーザー名、アクセストークンの設定をする
$ git config --global github.user username
$ git config --global github.token xxxxxxxxxxxxxxxxxxxxxx
接続を試してみる。
$ ssh git@github.com
ERROR: Hi username! You've successfully authenticated, but GitHub does not provide shell access
Connection to github.com closed.
successfully authenticatedのメッセージが帰ってくればOK
あとはgithubでリポジトリを作成すると、commitの仕方が表示されます。
RSS Subscription Extension(by Google) – Google Chrome 拡張機能ギャラリー
FirefoxのようにChromeでも簡単にRSSを登録できるようになる拡張機能
オプションからlivedoor Readerを追加
説明:「livedoor Reader」
URL:「http://reader.livedoor.com/subscribe/%s」
blogのデータと、redmineのwikiと、リポジトリが死にました。
超泣きたい。
PEAR::Services_Twitterのリスト対応
Changelog:
* Updated statuses/update method : added lat, long, place_id and display_coordinates parameters (closes feature request #17421)
* Added lists and trends support from http://blog.cheki.net/archives/1618
* Added generatePackage.php for easy package.xml management
Services_Twitter :: 0.6.0
ひどく他力によって。
Chromeのポストchaika、CrCh2が0.2にアップデートされました。
ChromeのExtentionsって勝手にアップデートされるの?よくわからんけど。
2chリンクの前に[CrCh2で開く]が強制的につくようになって地味にウザイ。
修正ファイル。
%userprofile%\AppData\Local\Google\Chrome\User Data\Default\Extensions\bidpjfcjipmhampdmejokganmjlhnpkd\0.2\contentscript.js
コメントアウトしてるとこをいじればリンク自体を書き換えてくれる。
そのうちオプションで指定できるようになるんだろうけど。
2NNみれればいいや、他で確認してたりしない。
//if(ch_exp.test(link.href))
//{
// var new_link = document.createElement(“span”);
// new_link.innerText = “[CrCh2で開く]“//link.innerText;
// new_link.className = “anchor”;
// new_link.churl = “http://” + RegExp.$2 + “.2ch.net/” + RegExp.$3 + “/dat/” + RegExp.$4 + “.dat”;
// new_link.dat = RegExp.$4;
// new_link.addEventListener(“click”, function() {
// chrome.extension.sendRequest({command:0,board:this.churl,dat:this.dat ,focus:0})
// }, false);
// var space = document.createElement(“span”);
// space.innerText = ” “;
// parent.insertBefore(space, link);
// parent.insertBefore(new_link, space);
// // parent.replaceChild(new_link, link);
//}
if(ch_exp.test(link.href))
{
link.churl = “http://” + RegExp.$2 + “.2ch.net/” + RegExp.$3 + “/dat/” + RegExp.$4 + “.dat”;
link.dat = RegExp.$4;
link.addEventListener(“click”, function() {
chrome.extension.sendRequest({command:0,board:this.churl,dat:this.dat ,focus:0})
}, false);
link.removeAttribute(‘href’);
link.removeAttribute(‘target’);
}
forで毎度countするとパフォーマンスが悪いというのは周知の事実だと思います。
注意される書き方。
$arr = range(1, 15);
for ($i = 0; $i < count($arr); $i++) {
echo $arr[$i];
}
一般的な書き方。
$arr = range(1, 15);
$cnt = count($arr);
for ($i = 0; $i < $cnt; $i++) {
echo $arr[$i];
}
俺カッコいいな書き方。一般的な書き方ではなく、見通しが悪いので自己満足極み。
$arr = range(1, 15);
for ($i = 0; $cnt = count($arr), $i < $cnt; $i++) {
echo $arr[$i];
}
上記のような使い方だと、代替としてforeachが利用でき、foreachのほうがパフォーマンスがいいという話。
foreach (range(1, 15) as $key => $val) {
echo $val;
}
PEAR::HTTP_OAuthでxAuth
require_once ‘HTTP/Request2.php’;
require_once ‘HTTP/OAuth/Consumer.php’;
$consumer_key = ‘YOUR-CONSUMER-KEY’;
$consumer_secret = ‘YOUR-CONSUMER-SECRET’;
$username = ‘YOUR-USER-NAME’;
$password = ‘YOUR-PASSWORD’;
$xauth_access_token_url = ‘https://api.twitter.com/oauth/access_token’;
$params = array(
‘x_auth_username’ => $username,
‘x_auth_password’ => $password,
‘x_auth_mode’ => ‘client_auth’,
);
try {
$request = new HTTP_Request2();
$request->setConfig(’ssl_verify_peer’, false);
$consumerRequest = new HTTP_OAuth_Consumer_Request();
$consumerRequest->accept($request);
$oauth = new HTTP_OAuth_Consumer($consumer_key, $consumer_secret);
$oauth->accept($consumerRequest);
$response = $oauth->sendRequest($xauth_access_token_url,
$params,
HTTP_Request2::METHOD_POST);
$data = $response->getDataFromBody();
// oauth_token, oauth_token_secret, user_id, screen_name, x_auth_expire
var_dump($data);
} catch (HTTP_OAuth_Exception $e) {
echo $e->toText();
exit;
}
mbstring.internal_encoding は UTF-8
Shift_JIS編
$to = 'test@docomo.ne.jp';
$from = 'from@example.jp';
$subject = 'あアア①'.pack('H*', 'EE98BE');
$body = 'あアア①'.pack('H*', 'EE98BE');
$headers = "From: ".$from;
$sendmail_param = "-f".$from;
$subject = '=?shift_jis?B?'.base64_encode(mb_convert_encoding($subject, 'cp932')).'?=';
$body = mb_convert_encoding($body, 'cp932');
mail($to, $subject, $body, $headers, $sendmail_param);
ダーティーなところ。
メールヘッダは78文字毎にCRLFで改行すべき(should)だが、しなければならない(must)じゃないので無視する。
mimeエンコードはクライアントが識別できるShift_JISするが、実際の文字コードはcp932を利用する。
ISO-2022-JP編
$to = ‘test@docomo.ne.jp’;
$from = ‘from@example.jp’;
$subject = ‘あアア’;
$body = ‘あアア’;
$headers = “From: “.$from;
$sendmail_param = “-f”.$from;
$subject = ‘=?iso-2022-jp?B?’.base64_encode(mb_convert_encoding($subject, ‘jis’)).’?=’;
$body = mb_convert_encoding($body, ‘jis’);
mail($to, $subject, $body, $headers, $sendmail_param);
PHP5.2.1以上の環境ならば「jis」→「iso-2022-jp-ms」にすると①等も送信できる。