This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\BackendBundle\Controller; | |
use Symfony\Bundle\FrameworkBundle\Controller\Controller; | |
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; | |
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; | |
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; | |
use Symfony\Component\Security\Core\SecurityContext; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function calcular_moedas($valor) { | |
$moedas_disponiveis = array(0.5, 0.25, 0.1, 0.05, 0.01); | |
$quantidade_moedas = array(); | |
$soma = 0.0; | |
foreach($moedas_disponiveis as $moeda) { | |
while($valor > ($soma + $moeda)) { | |
if(!isset($quantidade_moedas["{$moeda}"])) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# crédito http://brunitto.wordpress.com/2011/10/15/tutorial-instalando-o-mysql-5-5-16-no-ubuntu-server-11-10/ | |
mkdir /opt/src | |
cd /opt/src | |
curl -O http://linorg.usp.br/mysqlDownloads/MySQL-5.5/mysql-5.5.22.tar.gz | |
apt-get install gcc g++ make cmake autoconf | |
apt-get install libaio1 libaio-dev | |
apt-get install libncurses5-dev | |
tar --extract --gzip --file mysql-5.5.22.tar.gz | |
cd mysql-5.5.22 | |
cmake . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://drakos7.net/2012/02/installing-php-5-4-0rc8-and-apache-2-4-on-ubuntu-11-10 | |
apt-get update | |
apt-get -y -q install make g++ flex bison build-essential zlib1g-dev binutils \ | |
cmake automake autoconf libmcrypt-dev libmhash-dev libxslt1-dev \ | |
libtidy-dev libbz2-dev libxml2-dev libssl-dev libmysqlclient16 libmysqlclient16-dev \ | |
libpng12-dev libpng12-0 libpng3 libjpeg62 libjpeg62-dev libxpm-dev libpcre3 \ | |
libpcre3-dev zlib1g zlib1g-dev libltdl-dev libltdl7 pkg-config \ | |
libcurl4-openssl-dev libfreetype6 libfreetype6-dev libc-client2007e \ | |
libc-client2007e-dev libkrb5-3 libkrb5-dev openssl libglobus-openssl \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Em resposta à essa imagem: | |
// https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-ash4/305534_10150769324963360_290539813359_9393694_635337580_n.jpg | |
class Baba implements arrayaccess { | |
private $counter = 0; | |
public function offsetSet($offset, $value) { | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: elasticsearch | |
# Required-Start: $all | |
# Required-Stop: $all | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Starts elasticsearch | |
# Description: Starts elasticsearch using start-stop-daemon | |
### END INIT INFO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class NewsController { | |
@Inject | |
private News news; | |
@Inject | |
private Author authors; | |
array respond_to() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Test; | |
use Eflop\Dispatcher\Router\Handlers\Post; | |
use Eflop\Dispatcher\Router\Register; | |
$register = new Register(); | |
// Home |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<snippet> | |
<content><![CDATA[${1:namespace ${2:Bar\Foo}; | |
} | |
class ${3:ClassName}${4: extends ${5:AnotherClass}} | |
{ | |
${6:/*** | |
* $7 | |
*/} | |
function ${8:__construct}(${9:argument}) { | |
${0:# code...} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Picoznd/Session; | |
use Picoznd/Http/Request; | |
use Picoznd/Http/Response; | |
use Picoznd/Http/Response/CacheControl; | |
use Picoznd/IoC/Inject/Bag as InjectBag; | |
use Picoznd/Http/Request/Params as ParamsBag; | |
class Index |