2008-03-01から1ヶ月間の記事一覧
class Hoge HOGE_FUGA = "mogemoge" def hoge HOGE_FUGA end end class Moge < Hoge end hoge = Hoge.new hoge.hoge Hoge::HOGE_FUGA Moge::HOGE_FUGA ↓ "mogemoge" "mogemoge" "mogemoge"
rubyダウンロード yumがruby1.8.5しかないみたい。 1.8.6じゃないとGetTextとRails2.xでなんかよくないとかどっかで見たので、1.8.6が入れたい。 なので、落としてきて入れる。 wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.6-p114.tar.bz2 wget htt…
initialize: function(id) { this.id = id; Event.observe($('fs_bt_submit'), 'click', this.on_submit, false); }, on_submit: function() { console.log(this.id); } だと、コールバックon_sucmitではthisはDOMのidになる。 $('fs_bt_submit')を押してる…
EUC_JPで作りたい場合 createdb mogemoge -h xxx.xxx.xxx.xxx -U crimaru -E EUC_JP
net_userAgent_mobile βリリースなので-fとかつける pear install -f -o net_userAgent_mobile 参考 Net_UserAgent_Mobile PEAR::Net_UserAgent_Mobile 3G対応携帯判別(ケータイ判別) [dozo dokuwiki.php] db calendar date pager
/etc/init.dがない>< /etc/rc.d/* apacheを再起動 /usr/local/sbin/apachectl stop #落ちなかった /usr/local/sbin/httpd -k stop #落ちた /usr/local/sbin/apachectl start #上がってきた
steltherを抜いてもリファラ送信されなかった。 なんか、configの値がかわったままになってた。http://www.mozilla-japan.org/kb/solution/2030
jqueryの$(function(){});もついでにメモ <input type="button" value="hogehoge" id="go_hoge" /> <script type="text/javascript"> //<![CDATA[ $(function(){ $("#go_hoge").click(function(){ window.location.href = "./hoge.html"; }); }); //]]> </script>
http://www.knallgrau.at/code/colorpicker を使う。 ダウンロード wget http://www.knallgrau.at/code/colorpicker/files/colorpicker.zip 配置 public + images + blank.gif + hline.png + hue.png + picker.png + pickerbg.png + select.gif + javascript…
ハイクでおそわりました。 知らなかったーTT。
表作るときこまってた table { border : 1px solid #000; border-spacing:0px; border-collapse:collapse; }
environment.rbの最後に require 'gettext/rails' application.rbに init_gettext 'hogehogemogemoge'でとりあえず。 他にも色々あるので以下参考あとで書く http://www.yotabanana.com/hiki/ja/ruby-gettext-howto-ror.html Ruby On Rails ピチカート街道 -…
modelに定数が書いておけると便利なときもあると思う class Moge < ActiveRecord::Base @@hoge = "hogehoge" @@fuga = "fugafuga" cattr_accessor :hoge, :fuga confにconfigファイル的なyamlを置いておいてアプリで使いたい application.rbで $app_config =…
インストール gem install hpricot gem install mechanize 徐々に書き足す つもり
今現在on自宅mac actionmailer (2.0.2, 1.3.6, 1.3.3) actionpack (2.0.2, 1.13.6, 1.13.3) actionwebservice (1.2.6, 1.2.3) activerecord (2.0.2, 1.15.6, 1.15.3) activeresource (2.0.2) activesupport (2.0.2, 1.4.4, 1.4.2) acts_as_ferret (0.4.3, 0.…
rake db_schema_dumpで、db/schema.rbができあがる。 参考 http://tam.qmix.org/wiki/Migration.html
smarty拡張クラスを作る function smarty_function_csrf_token($params, &$o_smarty){ if(session_id() == ""){ session_start(); } $key = session_id(); return "<input type=\"hidden\" name=\"_csrf_token\" value=\"". $key ."\" />"; } で、テンプレートで {csrt_token}で呼ぶと
magic_quotes_gpc = Offにするのが基本みたい。 参考 [PHP4]phpの文字化けとphp.iniの設定 | ごった煮 - tips about programming and building a server
postgresql.confのlog_statement = 'none'をいじる #log_statement = 'none' # none, ddl, mod, all log_statement = 'all' # none, ddl, mod, allそしたら log_directory = 'pg_log' のとこにできる。要postgresql再起動 参考 http://katsubemakito.net/cgi…
フィルター function __construct(){ #略 $this->register_prefilter('toEUC'); } 関数のオーバーライド displayに処理追加 例えば携帯だったら、SJISで出すみたいな function display($resource_name, $cache_id = null, $compile_id = null) { $content = …
SJISだとエラーになる。 須の2バイト目がダメポ {literal}必須{/literal} 参考 プログラミング/PHP/smarty - Naoebi Wiki
add_column :hoge, :fuga, :integer, {:null => false} だと、 rake aborted! PGError: ERROR: column "figa" contains null values : ALTER TABLE hoge ALTER "fuga" SET NOT NULLと怒られた add_column :hoge, :fuga, :integer, {:null => false, :default…
>> "%04d%02d%4s" % [1, 4, "hoge"] => "000104hoge" で、おk
railsのview_helper的なことがしたい。 {php}{/php}でくくる。 適当なフォルダにviewヘルパを作っておいて、そいつをrequireして、 function呼べる。 {php} require_once(APP_DIR."helper/_view_helper.php"); get_categories(1); #_view_helper.phpの中にge…
postgresはMONTHない 今月のエントリされた日付けをとりだす。 select date_part('day',entry_datetime) as day from entry where date_part('month',entry_datetime) = date_part('month',now()); 2007年2月のエントリだけ取り出す。 select * from entry w…
wget http://pecl.php.net/get/xdebug-2.0.2.tgz tar zxvf xdebug-2.0.2.tgz cd xdebug-2.0.2 phpize Configuring for: PHP Api Version: 20041225 Zend Module Api No: 20060613 Zend Extension Api No: 220060519 ./configure --enable-xdebug make cp -i …
ユーザー作る createuser -a -d -U postgres -P crimaru 参考 PostgreSQLのユーザ作成、データベース作成等の基本操作
Apache入れるyumで cd /etc/yum.repos.d/ wget http://centos.karan.org/kbsingh-CentOS-Extras.repo dag.repoを作って [dag] name=Dag RPM Repository for Fedora Core baseurl=http://ftp.riken.jp/Linux/dag/redhat/el$releasever/en/$basearch/dag enabl…
まだ全然見てないけど、rubyスクリプトが同梱されてる。ジェネレータと思われる。 0.6からバンと置き換えてみたら、激しく見た目が変わってしまった。。w 自分の書いてたHTML+CSSにも問題あるだろうから、blueprintのせいだけじゃないだろうけど、テーブル…
OpenwaveSDKで確認してたら、 !request.mobile.supports_cookie?がfalseなのに、 シミュレータの方ではcookie食えなかった。 ので、場当たり的に if transit_sid_mode == :mobile if request.mobile? if cookies.blank? return true else return !request.mo…