Skip to content

Instantly share code, notes, and snippets.

View cordoval's full-sized avatar

Luis Cordova cordoval

View GitHub Profile
<?php
namespace Ibms\Helper;
use Symfony\Bundle\FrameworkBundle\Templating\GlobalVariables as BaseGlobalVariables;
use Symfony\Component\DependencyInjection\ContainerInterface;
use DateTime;
class GlobalVariables extends BaseGlobalVariables
{
<?php
/**
* This file is part of the Infinite Helper Library
*
* (c) Infinite Networks Pty Ltd <http://www.infinite.net.au>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

Awesome PHP

A list of amazingly awesome PHP libraries, resources and shiny things.

Composer

<?php
$app->get('/user/{user}', ...)
->convert('user', function ($user) use ($db) {
return $db->find('user', $user);
})
$app->get('/user/{user}', ...)
->setDefault('user', function ($user) use ($db) {
return $db->find('user', $user);
# Setting up a local solr instance on a mac
# install solr with homebrew
brew install solr
# create the base solr index directory
mkdir -p /data/solr
# make sure you can write to the solr logs
sudo chown -R `whoami` /usr/local/Cellar/solr/
<?php
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
require_once __DIR__ . '/vendor/autoload.php';
class User {
public $Username;
public $Email;
@cordoval
cordoval / my.cnf
Created February 21, 2013 04:35 — forked from hacfi/my.cnf
[mysql]
port = 3306
socket = /usr/local/var/run/mysql.sock
[mysqld]
#user = mysql
default_storage_engine = InnoDB
socket = /usr/local/var/run/mysql.sock
pid_file = /usr/local/var/run/mysql.pid
@cordoval
cordoval / my.cnf
Created February 17, 2013 02:53 — forked from hacfi/my.cnf
[mysql]
port = 3306
socket = /usr/local/var/run/mysql.sock
[mysqld]
#user = mysql
default_storage_engine = InnoDB
socket = /usr/local/var/run/mysql.sock
pid_file = /usr/local/var/run/mysql.pid

1) Install git-core

$ sudo port selfupdate               # updates the ports tree and port utility
$ sudo port install git-core +svn    # installs git

2) Create your ~/.git-prompt.sh ~/.bash_rc

Open vi and paste the following code, save file as ~/.git-prompt.sh: