- http://lostechies.com/derickbailey/2012/06/04/anders-hejlsberg-is-right-you-cannot-maintain-large-programs-in-javascript/
- http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod
- http://en.wikipedia.orgi/wiki/Separation_of_concerns
- Single Responsibility Principle: http://www.objectmentor.com/resources/articles/srp.pdf
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
describe("class system", function(){ | |
it("should be possible to create classes", function(){ | |
Class({name:'MyClass'}); | |
expect(window.MyClass === undefined).toBeFalsy(); | |
}); | |
it("should be possible to create properties within classes", function(){ | |
Class({ | |
name:'MyClass', | |
attrs:{ |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 | |
$postos = array( | |
'A' => 'atendimento.jpg', | |
'B' => 'banheiros.jpg', | |
'1' => 'borracharia.jpg', | |
'2' => 'brindes.jpg', | |
'C' => 'churrascaria.jpg', | |
'E' => 'estacionamento.jpg', | |
'G' => 'gasolina.jpg', | |
'L' => 'loja.jpg', |
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 | |
require 'php-captcha.inc.php'; | |
# // define fonts | |
$fonts = '/home/guga/public_html/232classificados/captcha/fonts/'; | |
$aFonts = array( | |
$fonts . 'VeraBd.ttf', | |
$fonts . 'VeraIt.ttf', | |
$fonts . 'Vera.ttf' | |
); |
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 | |
//na parte de interface de usuário, faça com que o value | |
//contenha apenas o valor numérico do mês | |
echo '<select name="parametro">'; | |
foreach (range(1, 12) as $month) { | |
printf('<option value="%d">%02d</option>', $month, $month); | |
} | |
echo '</select>'; | |
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 | |
$string = '04/09/2013 VANESSA RAFFLER 5199060 28/08/2013 13:40 EMISSAO CO IBITINGA 01 28/08/2013 18:58 TRANSFERENCIA TECA JAD SAO 29/08/2013 00:23 ENTRADA TECA JAD SAO 29/08/2013 02:50 TRANSFERENCIA CO CURITIBA 01 29/08/2013 10:23 TRANSFERENCIA CO UNIAO DA VITORIA 01 29/08/2013 20:20 TRANSFERENCIA CO CURITIBA 01 29/08/2013 23:52 TRANSFERENCIA CO CURITIBA 01 30/08/2013 06:50 TRANSFERENCIA CO UNIAO DA VITORIA 01 30/08/2013 12:44 TRANSFERENCIA CO CHAPECO 01 02/09/2013 08:01 ENTRADA CO CHAPECO 01 02/09/2013 09:50 EM ROTA CO CHAPECO 01 03/09/2013 09:22 ENTREGUE CO CHAPECO 01 03/09/2013 09:26 ENDERECO NAO LOCALIZADO CO CHAPECO 01 04/09/2013 09:40 EM ROTA CO CHAPECO 01 05/09/2013 09:06 ENTREGUE CO CHAPECO 01'; | |
$matches = array(); | |
if (preg_match_all('/[^\s].*?(?=\s\d{2}\/\d{2}\/\d{4})/', $string, $matches)) { | |
print_r($matches[0]); | |
} |
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 | |
// dir classe/Usuario | |
namespace classe; | |
class Usuario | |
{ | |
private $email; | |
private $senha; |
Estas são as regras do grupo PHP Brasil. Elas são simples, mas diretas e objetivas. Ao participar do grupo você declara que está ciente e concorda integralmente com cada item exposto abaixo. A não leitura das regras não o libera do cumprimento integral das mesmas.
O descumprimento das regras pode ser punido com banimento definitivo do membro, ou apenas remoção do conteúdo. A análise é feita caso a caso por um dos moderadores do grupo. Abaixo, de forma sintética, alguns itens que não são aceitos no grupo:
- Publicação de promoções de empresas.
- Publicação de promoções de produtos.
- Publicação de auto promoção (ex: posts de conteúdo com o único objetivo de se auto promover).
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 | |
/** | |
* Eu já disse que o nome Entidades é muito ruim para um namespace? | |
*/ | |
namespace Entidades; | |
class Company | |
{ | |
private $contacts = array(); | |
private $contactIterator; |
OlderNewer