This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<select name="pref"> | |
<option value=""></option> | |
<optgroup label="北海道・東北"> | |
<option value="北海道">北海道</option> | |
<option value="青森県">青森県</option> | |
<option value="岩手県">岩手県</option> | |
<option value="宮城県">宮城県</option> | |
<option value="秋田県">秋田県</option> | |
<option value="山形県">山形県</option> | |
<option value="福島県">福島県</option> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* var */ my_zen_settings = { | |
'variables': { | |
'lang': 'ja', | |
'locale': 'ja-JP', | |
'charset': 'UTF-8', | |
'profile': 'xhtml', | |
'indentation': ' ', | |
'jquery_version': '1.5.0', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
var menu = Editor.addMenu('my'); | |
addMenuItem(menu, { | |
name: 'text to unicode escape', | |
key: 'Ctrl+U', | |
action: function(){ Editor.currentView.text = toUnicodeEscape(Editor.currentView.text) } | |
}); | |
addMenuItem(menu, { | |
name: 'unicode escape to text', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once 'Zend/Gdata.php'; | |
require_once 'Zend/Gdata/ClientLogin.php'; | |
require_once 'Zend/Gdata/Spreadsheets.php'; | |
$user = ''; // GoodleアカウントのID | |
$pass = ''; // Googleアカウントのパスワード | |
$spreadsheet_key = ''; // スプレッドシートのキー(スプレッドシートのURLのkey部分) | |
$worksheet_id = 1; // ワークシートのID(インデックス。1-origin) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* jQuery placeholder fallback plugin (public domain) | |
* | |
* HTML5のplaceholderを実装していないブラウザでplaceholderの動作を模倣します。 | |
* .val()で値を設定するのを避け、<label>を生成して<input>/<textarea>上に被せます。 | |
* | |
* | |
* 使用例: | |
* $(function(){ | |
* $('input, textarea').placeholder(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// {app}/config/database.php | |
class DATABASE_CONFIG | |
{ | |
var $default = array( | |
// デフォルトのDB設定... | |
); | |
// https://github.com/cakephp/datasources を導入してArraySource用のDB設定を追加します。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // {app}/models/user.php | |
// 1. usernameとpasswordフィールドを持つUserモデルを作成します。 | |
class User extends AppModel | |
{ | |
var $name = 'User'; | |
var $displayField = 'username'; | |
} | |
/* | |
CREATE TABLE users( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// http://developer.hatena.ne.jp/ja/documents/auth/apis/oauth/consumer#sample-ruby | |
require_once 'lib/limonade.php'; | |
require_once 'HTTP/OAuth/Consumer.php'; | |
session_start(); | |
function before(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* jQuery x plugin | |
*/ | |
(function($) { | |
var pluginName = ""; | |
var plugin = function(options) { | |
var settings = $.extend({}, plugin.defaults, options); | |
return this.each(function() { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once 'Services/Amazon.php'; | |
// Product Advertising APIのアカウントを作成し、 | |
// https://aws-portal.amazon.com/gp/aws/developer/account/index.html?action=access-key | |
// からアクセスキーなどの情報をコピーしてきます。 | |
$access_key = ''; // 上記URLのアクセスキーID | |
$access_key_secret = ''; // 上記URLのシークレットアクセスキー |