This file contains hidden or 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 | |
class Color | |
{ | |
private const VALID_COLORS = ["branco", "preto", "vermelho", "azul"]; | |
private $color; | |
private function __construct($color) { | |
$this->color = $color; | |
} |
This file contains hidden or 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
using System; | |
using System.Collections.Generic; | |
using System.Linq.Expressions; | |
using System.Threading.Tasks; | |
using PixelAzul.CrossCutting.Pagination; | |
namespace PixelAzul.Domain.Interfaces.Repositories | |
{ | |
public interface IBaseRepository<TEntity, TKey> | |
where TEntity: Entity |
This file contains hidden or 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
public static string ToSlug(this string source, short limit) | |
{ | |
// Is the source null? | |
if (null == source) { | |
return ""; | |
} | |
// Remove accents | |
var bytes = Encoding.GetEncoding("Cyrillic").GetBytes(source); | |
var value = Encoding.ASCII.GetString(bytes); |
This file contains hidden or 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 getNextPayDate($day, DateTime $startDate = null) | |
{ | |
$date = new DateTime; | |
if (null !== $startDate) { | |
$date = clone $startDate; | |
} |
This file contains hidden or 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
# -*- mode: ruby -*- | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.box = "trusty" | |
config.vm.network "private_network", ip: "192.168.33.10" | |
config.vm.synced_folder "../", "/var/www", id: "vagrant-root", mount_options: ["dmode=775,fmode=774"] | |
config.vm.provider "virtualbox" do |v| |
This file contains hidden or 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
{"id":10080356,"name":"Pink Sale - Trio de Sombras Minerais Zen in Bloom - Garden Sky","price":34,"points":17} | |
{"id":10080359,"name":"Pink Sale - Esmalte para as Unhas Zen in Bloom - Pink Bamboo","price":19,"points":9} | |
{"id":10080358,"name":"Pink Sale - Esmalte para as Unhas Zen in Bloom - Blue Lotus","price":19,"points":9} | |
{"id":10080357,"name":"Pink Sale - Esmalte para as Unhas Zen in Bloom - Ginseng Blossom","price":19,"points":9} | |
{"id":10080361,"name":"Pink Sale - Brilho Labial Zen in Bloom - Chai Latte","price":34,"points":17} | |
{"id":10080360,"name":"Pink Sale - Brilho Labial Zen in Bloom - Pink Pagoda","price":34,"points":17} | |
{"id":8080363,"name":"Pink Sale - Skin Adesivo para Mini Compacto Zen in Bloom","price":4.5,"points":0} | |
{"id":8080362,"name":"Pink Sale - Necessaire Kimono Zen in Bloom","price":10,"points":0} | |
{"id":10083623,"name":"Promo\u00e7\u00e3o Ago'14 - Kit Microdermoabras\u00e3o TimeWise\u00ae (pedido com n\u00edvel de desconto 35%)","price":142,"points":98} | |
{"id":10083624,"name":"Promo\u00e |
This file contains hidden or 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 | |
class Roda | |
{ | |
} | |
// O carro cria as rodas | |
class Carro | |
{ |
This file contains hidden or 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 amigoSecreto(array $people) | |
{ | |
shuffle($people); | |
$temp = array(); | |
do { | |
array_push($temp, current($people), next($people)); | |
} while(current($people)); |
This file contains hidden or 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
sudo aptitude install libpng-dev libvpx-dev libjpeg-dev | |
./configure --with-gd --with-jpeg-dir=/usr/lib/ --with-vpx-dir=/usr/lib/ |
This file contains hidden or 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
wget http://launchpadlibrarian.net/140087283/libbison-dev_2.7.1.dfsg-1_amd64.deb | |
wget http://launchpadlibrarian.net/140087282/bison_2.7.1.dfsg-1_amd64.deb | |
sudo dpkg -i libbison-dev_2.7.1.dfsg-1_amd64.deb | |
sudo dpkg -i bison_2.7.1.dfsg-1_amd64.deb |