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 | |
// module/Application/src/Application/Controller/FilesController.php | |
# ... | |
class FilesController | |
{ | |
#... | |
public function indexAction() | |
{ | |
$uploadDir = $this->getService('upload')->directory; |
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
./configure --prefix=/usr/local/nginx/ --conf-path=/etc/nginx/nginx.conf --pid-path=/var/run/nginx.pid --error-log-path=/var/log/nginx/error.log --user=www-data --group=www-data --with-http_ssl_module --with-http_stub_status_module --without-http_uwsgi_module --without-http_scgi_module --http-log-path=/var/log/nginx/access.log --without-mail_pop3_module --without-mail_imap_module --without-mail_smtp_module --with-pcre --http-client-body-temp-path=/var/tmp/nginx/client/ --http-proxy-temp-path=/var/tmp/nginx/proxy/ --http-fastcgi-temp-path=/var/tmp/nginx/fcgi/ --with-http_gzip_static_module --with-http_flv_module --sbin-path=/usr/sbin/nginx --lock-path=/var/lock/nginx.lock --with-ipv6 --with-http_spdy_module |
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 | |
namespace Entidades; | |
use Exception; | |
class Contato | |
{ | |
private $idContato; | |
private $telefone; |
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
Trait MagicGetSet | |
{ | |
public function __set($key, $value) | |
{ | |
$setMethod = 'set' . ucfirst($key); | |
if (method_exists($this, $setMethod)) { | |
return $this->$setMethod($value); | |
} | |
$this->$key = $value; |
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 | |
$cpfs = array( | |
'123.456.789-09', | |
'2.3.4.4.6.8.2.7.3.4.6', | |
'528.462.34.278', | |
'23131378912' | |
); | |
foreach ($cpfs as $cpf) { |
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
{ | |
"meta": { | |
"code": 200 | |
}, | |
"notifications": [ | |
{ | |
"type": "notificationTray", | |
"item": { | |
"unreadCount": 16 | |
} |
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 | |
// resposta: https://www.facebook.com/groups/nao.tem.biscoito/permalink/10153103467920160/ | |
$cpf = preg_replace('@^(\d{3})(\d{3})(\d{3})(\d{2})$@', '$1.$2.$3-$4', '12345678900'); | |
echo $cpf; |
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 | |
// PHP >= 5.3 | |
// resposta: https://www.facebook.com/groups/nao.tem.biscoito/permalink/10153102397605160/ | |
$required = 282261; | |
$itens = array_filter($seuArray, function($item) use ($required) { | |
return $item[0] == $required; | |
}); |
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 Controller | |
{ | |
public function indexAction() | |
{ | |
$repo = $this->getRepository('User'); |
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 | |
if ($argc < 2) { | |
die ('Use textsplit.php /path/do/arquivo linhas'); | |
} | |
if (!isset($argv[2])) { | |
$argv[2] = 1000; | |
} |