Skip to content

Instantly share code, notes, and snippets.

View nojimage's full-sized avatar

Takashi Nojima nojimage

View GitHub Profile
@nojimage
nojimage / build_acl.php
Created June 11, 2010 01:45
CakePHP An Automated tool for creating ACOs fix
<?php
/**
* @see http://book.cakephp.org/view/1549/An-Automated-tool-for-creating-ACOs
*/
function build_acl() {
if (!Configure::read('debug')) {
return $this->_stop();
}
$log = array();
@nojimage
nojimage / acl_plus.php
Created June 11, 2010 06:40
Extend Acl Behavior
<?php
App::import('Behavior', 'Acl');
/**
* Extend Acl Behavior
*
* PHP versions 4, 5
*
* Copyright 2011, ELASTIC Consultants Inc. (http://elasticconsultants.com)
@nojimage
nojimage / helpers-code-completion.php
Created August 18, 2010 01:12
Code compleation for CakePHP Helpers in Eclipse PDT
<?php
/**
* Code compleation for CakePHP Helpers in Eclipse PDT
*
* @author nojimage (http://php-tips.com/)
* @original Mark Story | http://mark-story.com/posts/view/code-completion-for-cakephp-in-eclipse
*/
// stop page loading
exit;
@nojimage
nojimage / i18n.php
Created August 24, 2010 06:36
CakePHP i18n schema for char(36) id
<?php
/* i18n schema generated on: 2007-11-25 07:11:25 : 1196004805 */
/**
* This is i18n Schema file
*
* Use it to configure database for i18n
*
* PHP versions 4 and 5
# Original code is http://wb.mysql.com/?p=777
# import the wb module
from wb import *
# import the grt module
import grt
# import the mforms module for GUI stuff
import mforms
@nojimage
nojimage / phparray_grt.py
Created November 16, 2010 11:49
MySQL Workbench Plugin - Query to PHP Array Format
##
# MySQL Workbench - Query to PHP Array Format Plugin
#
# author: nojimage
#
# original: http://wb.mysql.com/?p=677 verticalquery_grt.py by Alfredo Kojima
##
# import the wb module
from wb import *
<?php
class SeriController extends AppController {
var $uses = array();
function index() {
/*
$x=new App();
$x->__cache=1;
$x->__map=array("Core" => array("Router"
@nojimage
nojimage / cake
Created December 3, 2010 12:46
cakephp bash completion
###
# @file CakePHP cake console bash completion script
# @author nojimage
# @original tclineks http://bin.cakephp.org/saved/21917
# @license mit
_cake()
{
local cur prev opts base
COMPREPLY=()
@nojimage
nojimage / php-switch
Created December 8, 2010 11:36
php switch (php5.2 <-> php5.3) for macports
#!/usr/bin/env bash
##
# php switch (php5.2 <-> php5.3) for macports
#
# @original http://mark-story.com/posts/view/updating-to-php5-3-with-macports
#
PORT_BIN=/opt/local/bin/port
APACHECTL_BIN=/opt/local/apache2/bin/apachectl
function get_ports_installed_version(){
<?php
class ExTwitterFormHelper extends TwitterFormHelper {
/**
* create OAuth Link
*
* @param $options
* loading: loading message
* login: login link text
* datasource: datasource name (default: twitter)