Skip to content

Instantly share code, notes, and snippets.

@ttoz
ttoz / zip_search.html
Created April 24, 2012 07:55
Google Transliterationによる郵便番号からの住所検索
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<input type="text" class="zip" name="zip1" value="">
-
<input type="text" class="zip" name="zip2" value="">
<input type="button" value="郵便番号検索" onclick="getAddress()">
<script type="text/javascript">
function getAddress() {
var zipcode = [];
$('input.zip').each(function(){ zipcode.push($(this).attr('value')) });
$.getJSON('http://www.google.com/transliterate?langpair=ja-Hira|ja&text=' + zipcode.join("-") + '&jsonp=?', function(json){
@ttoz
ttoz / cmd.php
Created March 24, 2012 16:29
Windows版Eclipseのコンソールウィンドウをコマンドプロンプトとして活用するための外部ツール用PHPスクリプト
<?php
/**
* Input to eclipse's console view window
*
* Run > External Tools > External Tools configurations...
* Name cmd
* Maintab's Location C:\path\to\php.exe
* Maintab's Working Directory ${workspace_loc:/your_project}
* Maintab's Arguments C:\path\to\cmd.php
* click external tool button to run
@ttoz
ttoz / .htaccess
Created March 14, 2012 07:38
MVCフレームワーク用の一般的な.htaccess
DirectoryIndex index.php index.html
RewriteEngine on
# 該当ファイルが存在せず、かつindex.htmlが存在しない場合にのみ
# index.phpにリクエストクエリを渡して実行する。
# これにより、http://domain/static_html/にアクセスがあった場合に
# index.phpにリライトされることなく、index.htmlを表示できる。
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}/index.html !-f