Skip to content

Instantly share code, notes, and snippets.

Juan Felipe Alvarez Saldarriaga nebiros

Block or report user

Report or block nebiros

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
View mb_str_pad.php
<?php
/**
* mb_str_pad
*
* @param string $input
* @param int $pad_length
* @param string $pad_string
* @param int $pad_type
* @return string
@nebiros
nebiros / IndexController.php
Created Nov 30, 2009
Zend_Filter_Input on steroids
View IndexController.php
<?php
class IndexController extends Zend_Controller_Action {
public function someAction() {
if ( true === $this->getRequest()->isPost() ) {
// Validate form.
$someForm = new App_Filter_Input_SomeForm();
$someForm->setData( $this->getRequest()->getPost() );
if ( false === $someForm->isValid() ) {
View gist:246891
#
# How to install php/java bridge on Ubuntu.
#
# aptitude install sun-java6-jre sun-java6-fonts sun-java6-jdk liblucene-java libitext-java \
php5-dev php5-cgi libtcnative-1
# update-java-alternatives -s java-6-sun
# dpkg --force-architecture -i php-java-bridge_5.4.4.2-3_i386.deb
@nebiros
nebiros / index.php
Created Jan 14, 2010
How to implement Zend_Paginator without Zend
View index.php
<?php
defined( "APPLICATION_PATH" )
|| define( "APPLICATION_PATH", realpath( dirname( __FILE__ ) ) );
// Ensure library/ is on include_path.
set_include_path( implode( PATH_SEPARATOR, array(
realpath( APPLICATION_PATH . "/library" ), // Aca va a estar la carpeta Zend que viene con el .tag.gz del ZF
get_include_path(),
) ) );
@nebiros
nebiros / ErrorController.php
Created Jan 15, 2010
Display AJAX errors on Zend Framework
View ErrorController.php
<?php
class ErrorController extends Zend_Controller_Action
{
public function errorAction()
{
/** Other suff */
if ( true === $this->getRequest()->isXmlHttpRequest() )
{
@nebiros
nebiros / IndexController.php
Created Jan 28, 2010
Export data to excel on Zend Framework
View IndexController.php
<?php
class IndexController extends Zend_Controller_Action
{
public function exportXlsAction()
{
set_time_limit( 0 );
$model = new Default_Model_SomeModel();
$data = $model->getData();
View App_Thumb.php
<?php
class App_Thumb
{
protected $_width = null;
protected $_oldWidth = null;
protected $_height = null;
protected $_oldHeight = null;
protected $_imagePath = null;
protected $_resource = null;
@nebiros
nebiros / csvn.bat
Created Jun 13, 2010
Remove .svn folders on *nix and windoze
View csvn.bat
FOR /F "tokens=*" %G IN ('DIR /B /AD /S *.svn*') DO RMDIR /S /Q %G
View titanium_hold_menu.js
var holdTime = 2000, timeout;
productView.addEventListener( "touchstart", function ( e ) {
timeout = setTimeout( function( e ) {
// you function here. e.source is you tableViewRow.
var dialog = Titanium.UI.createOptionDialog( {
options: ["Notificar precio"],
destructive: 2,
cancel: 1,
title: "Opciones"
View Cache.php
<?php
/**
* Based on FileCache class by Erik Giberti,
* http://af-design.com/blog/2010/07/30/simple-file-based-caching-in-php/
*
* @author nebiros
*/
class App_Cache {
/**
You can’t perform that action at this time.