Skip to content

Instantly share code, notes, and snippets.

@icyleaf
icyleaf / Validate.php
Created June 10, 2010 08:26
Validate a Chinese ID
class Validate {
/**
* Validate a Chinese ID (18 digit ONLY).
* @param int ID
* @return boolean
*/
public static function chinese_id($id)
{
$id_length = strlen($id);
if ($id_length == 18)
@icyleaf
icyleaf / imgly.php
Created May 6, 2010 03:44
img.ly api package for kohana v3
<?php
/**
* img.ly class for Kohana v3.0.x
*
* @author icyleaf <[email protected]>
* @link http://icyleaf.com
* @version 0.1
* @license http://www.opensource.org/licenses/bsd-license.php
*/
class imgly {
@icyleaf
icyleaf / kohana-3-rest-server-sample.php
Created April 23, 2010 07:40
RESTful by Kohana v3.0.x + Sprig
<?php defined('SYSPATH') or die('No direct script access.');
/**
* People API - Example Code
*
* @author icyleaf <[email protected]>
* @link http://icyleaf.com
* @version 0.1
*/
class Controller_API_People extends Controller_REST {
@icyleaf
icyleaf / remote.php
Created March 31, 2010 03:16
HTTP Request/Response Library
<?php
/**
* Provides remote server communications options using [curl][ref-curl].
*
* [ref-curl]: http://php.net/curl
*
* @author icyleaf <[email protected]>
* @link http://icyleaf.com
* @version 0.3.1
* @license http://www.opensource.org/licenses/bsd-license.php