Skip to content

Instantly share code, notes, and snippets.

View allanfreitas's full-sized avatar
🏠
Working from home

Allan Freitas allanfreitas

🏠
Working from home
View GitHub Profile

Multiple PHP version under Ubuntu 13.04

Update your machine

apt-get update
apt-get ugrade

Install some dependencies

apt-get install build-essential

echo -----------------------------------------------------------------
echo - Mongo - Ubuntu 14.04 -
echo -----------------------------------------------------------------
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
sudo apt-get update
<?php
final class StatusCodes {
const HTTP_100 = 'HTTP/1.1 100 Continue';
const HTTP_101 = 'HTTP/1.1 101 Switching Protocols';
const HTTP_200 = 'HTTP/1.1 200 OK';
const HTTP_201 = 'HTTP/1.1 201 Created';
const HTTP_202 = 'HTTP/1.1 202 Accepted';
const HTTP_203 = 'HTTP/1.1 203 Non-Authoritative Information';
const HTTP_204 = 'HTTP/1.1 204 No Content';
// controller Ola ,
<?php
class OlaController extends BaseController {
public function showProfile()
{
//
<?php
/* * **
*
* This script converts an existing MySQL database to migrations in Laravel 4.
*
* 1. Place this file inside app/controllers/
*
* 2. In this file, edit the index() method to customize this script to your needs.
* - inside $migrate->ignore(), you pass in an array of table
from PySide.QtGui import QApplication
from PySide.QtCore import QUrl
from PySide.QtWebKit import QWebView
import sys
__autor__= 'Rodrigo Gomes'
app = QApplication(sys.argv)
b = QWebView()
b.load(QUrl('http:www.google.com'))
<?php
namespace H57\Util;
class Serializor {
/**
* Converts the Doctrine Entity into a JSON Representation
*
* @param object $object The Object (Typically a Doctrine Entity) to convert to an array
-- Function: clone_schema(text, text)
DROP FUNCTION clone_schema(text, text);
CREATE OR REPLACE FUNCTION clone_schema(source_schema text, dest_schema text)
RETURNS void AS
$BODY$
DECLARE
seq RECORD;
#!/bin/env python
import timeit
loops = 1000
setup = """
import MySQLdb
db = MySQLdb.connect(host="remotedb.example.com",
read_default_file="/root/.my.cnf",
$res = $conn->query('
SET @num := 0, @genre := "";
SELECT
id_artista,
artista,
art_url,
genero_url,
genero,
(