Skip to content

Instantly share code, notes, and snippets.

Simon Asika asika32764

Block or report user

Report or block asika32764

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@asika32764
asika32764 / addLink.php
Last active Oct 3, 2015
字串中網址自動加上超連結
View addLink.php
View gist:3827733
JoomlArt
http://www.joomlart.com/joomla/templates/showcase
YOOTheme
http://www.yootheme.com/themes
Rockettheme
http://www.rockettheme.com/joomla-templates
Joomlabamboo
View gist:4943196
<?php
/**
* @package Joomla.Administrator
* @subpackage com_flower
*
* @copyright Copyright (C) 2012 Asikart. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @author Generated by AKHelper - http://asikart.com
*/
View detectKeyPress.js
/*
* 判斷按下的按鈕是哪一個
* @param (event) e keypress event.
* @param (mix) targetKeyChar 按鍵的編號或名稱,如果是這個按鍵,就執行 callback
* @param (function) callBack 送入callback的function,不用加()括號
*
*/
var detectKeyPress = function(e, targetKeyChar, callBack){
var keynum
View pdftotext.php
<?php
public static function read($file)
{
shell_exec("/usr/bin/pdftotext {$file} {$filetmp}.txt") ;
$output = file_get_contents("{$filetmp}.txt");
return $output ;
}
View Model getItem.php
<?php
public function getSchools()
{
// Get City id for query School.
$id = $this->getState('city.id');
// Get Admin Model
JModelLegacy::addIncludePath( JPATH_COMPONENT_ADMINISTRATOR . '/models' );
$model = JModel::getInstance('Schools', 'TourModel', array('ignore_request' => true)) ;
View Grid-Example.php
<?php
include_once AKPATH_HTML.'/grid.php' ;
// Create a new Grid
$grid = new AKGrid( array('class' => 'adminlist', 'id' => 'table_id') );
// Set Columns
$grid->setColumns( array('week_start', 'price', 'discount', 'delete') ) ;
// Add First TR Row as thead
View gist:5590524
<?php
// Put in viewapi.class.php line 59
if( !is_callable( array($model, $method) ) ) {
ApiError::raiseError(500, "Method: {$class}::{$method} is not exists.");
return false;
}
View gist:5610373
public static function raise($level, $code, $msg, $info = null, $backtrace = false)
{
if( !empty(self::$levels[$level]) ){
$level = self::$levels[$level] ;
}else{
$level = self::$levels[E_NOTICE] ;
}
return call_user_func_array( array('ApiError', 'raise'.$level), array($level, $code, $msg, $info) ) ;
}
View get&set Array.php
<?php
class XXXHelperArray
{
/**
* Set a value into array or object.
*
* @param mixed $array An array to set value.
* @param string $key Array key to store this value.
You can’t perform that action at this time.