Skip to content

Instantly share code, notes, and snippets.

View ryhmrt's full-sized avatar

Ryohei Morita ryhmrt

  • Tokyo
View GitHub Profile
@ryhmrt
ryhmrt / builtin-server.php
Created November 19, 2012 09:57 — forked from tanakahisateru/builtin-server.php
CakePHP2 by PHP5.4 builtin server
<?php
/**
* Place this file in CakePHP's root dir and do:
* $ php -S localhost:8080 builtin-server.php
* with PHP5.4
*/
if (strpos($_SERVER['REQUEST_URI'], '?')) {
list($path, $param) = preg_split('/\?/', $_SERVER['REQUEST_URI'], 2);
} else {
$path = $_SERVER['REQUEST_URI'];
@ryhmrt
ryhmrt / User.rb
Created April 19, 2012 03:05 — forked from kenchan/User.rb
indent?
class User < ActiveRecord::Base
validates :email,
presence: true,
format: { with: VALID_EMAIL_REGEX },
uniqueness: { case_sensitive: false }
end