Skip to content

Instantly share code, notes, and snippets.

封神演義
最終兵器彼女
惑星のさみだれ
姫ちゃんのリボン
彼氏彼女の事情
01 ZERO ONE
修羅の門
修羅の刻
海皇紀
新暗行御史
public function rule_hoge (String $value) {
if (empty($value)) return false;
if (mb_strlen($value) < 100) return false;
if (preg_match('/fuga/', $value)) return false;
if (!$this->isFoo($value)) return false;
return true;
}
cat /etc/redhat-release //=> CentOS release 5.5 (Final)
yum search perl | wc -l // => 132
yum search python | wc -l // => 131
yum search ruby | wc -l // => 26
yum search php | wc -l // => 92
yum search java | wc -l // => 213
@aerith
aerith / cakephp-advent-calendar-2010.textile
Created December 16, 2010 04:15
gist という日記サービス

CakePHP2.0 を触ってみて。

2 の 4 乗の 16 日なので、CakePHP2.0 にすこし触れてみました。こじつけです。

ほんとうはもうすこしいろいろとやってみたかったんですが、忙しくてものすごく中途半端になってしまいました。穴があったら入りたい。

基本的なところはそれほどかわっていませんが、やっぱりまだまだこなれていない感じがありました。 今回使用したのは 2010 年 12 月 前半のあたりのもので、今もブランチが増えてたりしたので、今も開発は進んでいるところだと思います。 CakePHP2.0の概要(訳) で紹介されているものも、すでにいくつか実装されていたようです。

とりあえず導入

@aerith
aerith / app.psgi
Created November 26, 2010 01:37
動作確認ほとんどしてない。
#!/usr/bin/perl
package MyApp::Model;
use DBIx::Skinny connect_info => +{
dsn => 'dbi:SQLite:db/memo.sqlite',
};
1;
package MyApp::Model::Schema;
@aerith
aerith / webapp.rb
Created November 19, 2010 07:42 — forked from igrigorik/webapp.rb
require 'rubygems'
require 'rack'
class Object
def webapp
class << self
define_method :call do |env|
func, *attrs = env['PATH_INFO'].split('/').reject(&:empty?)
if !func.nil? &&
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:mx="library://ns.adobe.com/flex/mx" width="400" minHeight="400" creationComplete="creationCompleteHandler(event)">
<fx:Script>
<![CDATA[
import mx.events.VideoEvent;
import mx.events.SliderEvent;
private var playheadTimeSliderDragging:Boolean = false;
@aerith
aerith / Common.class.php
Created November 5, 2010 05:08
Ruby のソースほぼまるパク
<?php
namespace URI\RegExp\Pattern {
#
# Patterns used to parse URI's
#
# RFC 2396 (URI Generic Syntax)
# RFC 2732 (IPv6 Literal Addresses in URL's)
# RFC 2373 (IPv6 Addressing Architecture)
#!/bin/sh
perlbin=`which perl`
phpbin=`which php`
rubybin=`which ruby`
pythonbin=`which python`
if [ -x $perlbin ]; then
echo -n "==================================================\n"
echo "Perl Paths"
@aerith
aerith / dispatcher.js
Created October 28, 2010 11:37
動けばいいな、動くかな。
var dispatcher = {
dispatchees: [],
connect: function (pattern, action, options) {
dispatcher.dispatchees.push({
pattern: pattern,
action: action,
options: options || {}
});