Skip to content

Instantly share code, notes, and snippets.

View jfranciscos4's full-sized avatar
💭
I may be slow to respond.

J.F. Silva IV jfranciscos4

💭
I may be slow to respond.
View GitHub Profile
@jfranciscos4
jfranciscos4 / array_compare
Created October 25, 2012 23:30
Compara dois array (key and values)
<?php
// devel-takethisout-oper.web@gmail.com 17-Oct-2012 08:31
// Compares two arrays- keys and values (as strings) must match.
// Keys and order must be the same to be equal.
function arraysEqual($arr1, $arr2){
if(count($arr1) != count($arr2)){
return(FALSE);
}else{
$arrStr1 = serialize($arr1);
$arrStr2 = serialize($arr2);
@jfranciscos4
jfranciscos4 / build.xml
Created November 1, 2012 04:50 — forked from casimiroarruda/build.xml
Arquivo de configuração para o phing
<?xml version="1.0" encoding="UTF-8"?>
<project name="TheProject" default="build" basedir=".">
<!-- Altere estas propriedades adequando-as ao seu projeto -->
<property name="application.library" value="${project.basedir}/library"/>
<property name="application.tests" value="${project.basedir}/tests"/>
<property name="application.builddir" value="${project.basedir}/build"/>
<target name="build"
@jfranciscos4
jfranciscos4 / gist:5190200
Created March 18, 2013 19:42
confirm jQuery
jQuery(document).ready(function() {
jQuery('.action-remover').click(function(event) {
if( !confirm('Deseja realmente excluir a foto?') )
{ event.preventDefault(); }
});
});
@jfranciscos4
jfranciscos4 / gist:5594137
Last active December 17, 2015 10:19
Instalação básica de pacotes para o desenvolvimento em PHP 5 utilizando o sistema operacional linux (.deb).

Instalando o PHP 5

sudo apt-get install php5-common php5-mysql php5-xmlrpc php5-cgi php5-curl php5-gd php5-cli php5-fpm php-apc php-pear php5-dev php5-xdebug php5-imap php5-mcrypt php5-sqlite php5 php5-xsl php5-intl

PEAR

sudo pear channel-update PEAR
sudo pear upgrade PEAR

Instalando o MemCached

sudo apt-get install memcached
sudo apt-get install php5-memcache

@jfranciscos4
jfranciscos4 / gist:5937413
Last active December 19, 2015 09:59
Git Commands

Author: eitikimura Filename: GIT Updated:2011-10-16 21:10:32

Description: Git é um sistema de controle de versões distribuído, desenvolvido por Linus Torvalds e utilizado atualmente para o desenvolvimento do kernel do linux. Deck baseado em anotações pessoais e no Feliwiki: http://www.fml.eti.br/wiki/index.php/Git

  1. Clonar um repositório com layout padrão SVN (trunk,branches,tags) git svn clone --no-minimize-url --stdlayout <'url'>
@jfranciscos4
jfranciscos4 / gist:6245244
Created August 15, 2013 21:43
Initialize new navigation in ZF1
/**
* inicializa a navegação
*
* @return void
* @author Elton Minetto
* */
public function _initNavigation() {
/*
* navegacao
*/

#Introduction If you're a php developer on ubuntu, there comes the time where you have to install/reinstall your system. I did it already a few times and i decided to write down the steps for a typical web developer stack with php. This is for a developer machine and not for live environment!

I hope it's a help also for you!

#Installation stack

@jfranciscos4
jfranciscos4 / gist:6445195
Last active December 22, 2015 08:30
Configuração do sublime text 2
// While you can edit this file, it's best to put your changes in
// "User/Preferences.sublime-settings", which overrides the settings in here.
//
// Settings may also be placed in file type specific options files, for
// example, in Packages/Python/Python.sublime-settings for python files.
{
// Sets the colors used within the text area
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",
// Note that the font_face and font_size are overriden in the platform
@jfranciscos4
jfranciscos4 / TellAll.php
Created October 5, 2013 12:26
Na classe TellAll, os resultados são imediatamente impresso na tela, se você quer que eles ou não. Para fins de demonstração, isso é bom, mas como um módulo, outros módulos podem simplesmente querer usar as informações sobre o dispositivo e /ou no navegador. Então, como você vai ver, nem todas as classes incluem uma função de construtor.
<?php
// Saved as TellAll.php
class TellAll
{
private $_userAgent;
public function __construct()
{