Skip to content

Instantly share code, notes, and snippets.

View matheuseduardo's full-sized avatar
:octocat:
coding

Matheus Eduardo Silva Guimarães matheuseduardo

:octocat:
coding
View GitHub Profile
@matheuseduardo
matheuseduardo / Cake Composer.md
Created July 9, 2018 14:03 — forked from ogrrd/Cake Composer.md
Install Cake 2.x with Composer

Install CakePHP 2.x with Composer

Remove the main CakePHP lib directory

$ cd /path/to/your/website
$ rm -Rf ./lib

Add the following composer.json file

@matheuseduardo
matheuseduardo / cakephp-last-executed-query
Last active June 5, 2018 18:44 — forked from mikedamoiseau/cakephp-last-executed-query
CakePHP - Display last executed SQL query
// only for CakePHP 2.x
$lastquery = end($this->getDatasource()->getLog()['log'])['query'];
debug($lastquery);
@matheuseduardo
matheuseduardo / sample.php
Last active February 22, 2016 12:45 — forked from miguelfrmn/simpleimage.php
SimpleImage PHP Class
<?php
require_once('simpleimage.class.php');
// Usage:
// Load the original image
$image = new SimpleImage('lemon.jpg');
// Resize the image to 600px width and the proportional height
$image->resizeToWidth(600);
@matheuseduardo
matheuseduardo / get-page-by-slug.php
Last active March 23, 2022 07:58 — forked from micahblu/gist:5786794
get_page_by_slug - wordpress
<?php
/**
* Retrieve a page given its slug.
*
* @global wpdb $wpdb WordPress database abstraction object.
*
* @param string $page_slug Page slug
* @param string $output Optional. Output type. OBJECT, ARRAY_N, or ARRAY_A.
* Default OBJECT.
* @param string|array $post_type Optional. Post type or array of post types. Default 'page'.