Skip to content

Instantly share code, notes, and snippets.

View alfrekjv's full-sized avatar

Alfredo Juárez alfrekjv

View GitHub Profile
@alfrekjv
alfrekjv / gist:2795255
Created May 26, 2012 20:51
GZip Encode Support on Apache
AddType "text/css" .css.cgz
AddType "text/javascript" .js.jgz
AddEncoding gzip .jgz
AddEncoding gzip .cgz
@alfrekjv
alfrekjv / gist:3426557
Created August 22, 2012 15:07
Sample form
<?php
$city = array(
'city' => array(
'action' => 'admin/city/add',
'method' => 'post',
'legend' => __('Add City'),
'class' => 'span12',
'fields' => array(
'state_id' => array(
@alfrekjv
alfrekjv / RecentComments.php
Created September 11, 2012 19:04
RecentComments Class
<?php
namespace BlogModule\Classes;
class RecentComments {
public $cache = NULL;
public function __construct($cache)
{
@alfrekjv
alfrekjv / RecentComments.php
Created September 11, 2012 19:21
RecentComments Class
<?php
namespace BlogModule\Classes;
class RecentComments {
public $cache = NULL;
public function __construct($cache)
{
public function getRecentCommentsAction()
{
$recentCommentsHelper = new \BlogModule\Classes\RecentComments($this->getService('blog.cache'));
$recentComments = $recentCommentsHelper->getComments();
return json_encode(array('comments' => $recentComments));
}
$.get(ppi.baseUrl + 'blog/get_recent_comments', {}, function(response) {
var content;
if (response.comments.length == 0) {
content = '<li><p>No Recent Comments</p></li>';
} else {
content = Mustache.render($('#recent-comments-template').html(), response);
}
@alfrekjv
alfrekjv / DownloadEntry.php
Created October 14, 2012 16:43
DownloadEntry
<?php
namespace Application\Storage;
use Application\Storage\Base as BaseStorage;
use Application\Entity\DownloadEntry as DownloadEntryEntity;
class DownloadEntry extends BaseStorage
{
protected $_meta = array(
'conn' => 'main',
@alfrekjv
alfrekjv / gist:3976604
Created October 29, 2012 21:18
UserMetaEntity
<?php
namespace UserModule\Entity;
class UserMeta
{
protected $_id = null;
protected $_user_id = null;
protected $_user_key = null;
<?php
namespace FourSquareModule\Classes;
class ApiHandler
{
protected $secret;
protected $key;
protected $cache;
<?php
namespace FourSquareModule\Controller;
use FourSquareModule\Controller\Shared as SharedController;
class Index extends SharedController
{
public function indexAction()
{