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
def valid_cns?(cns) | |
# Verifica se o tamanho do CNS está correto | |
return false unless cns.length == 15 | |
# Verifica se os primeiros 14 dígitos são números | |
return false unless cns[0..13].scan(/\D/).empty? | |
# Verifica se o último dígito é um número ou uma letra | |
return false unless cns[14] =~ /[\dX]/ |
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
# remove containers exited | |
docker rm $(docker ps -a -f status=exited -q) | |
# remove unused images | |
docker rmi $(docker images -f dangling=true -q) | |
# get IP from container | |
docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' container_name_or_id | |
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
# This is a skeleton for testing models including examples of validations, callbacks, | |
# scopes, instance & class methods, associations, and more. | |
# Pick and choose what you want, as all models don't NEED to be tested at this depth. | |
# | |
# I'm always eager to hear new tips & suggestions as I'm still new to testing, | |
# so if you have any, please share! | |
# | |
# @kyletcarlson | |
# | |
# This skeleton also assumes you're using the following gems: |
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
# Add in ~/.bashrc or ~/.bash_profile | |
function parse_git_branch () { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
} | |
RED="\[\033[01;31m\]" | |
YELLOW="\[\033[01;33m\]" | |
GREEN="\[\033[01;32m\]" | |
BLUE="\[\033[01;34m\]" | |
NO_COLOR="\[\033[00m\]" |
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 | |
/*In Provider*/ | |
... | |
/** | |
* Register the application services. | |
* | |
* @return void | |
*/ | |
public function register() |
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 | |
return array( | |
'doctrine' => array( | |
'connection' => array( | |
'orm_default' => array( | |
'driverClass' => 'Doctrine\DBAL\Driver\PDOMySql\Driver', | |
'params' => array( | |
'password' => '', | |
'dbname' => 'ecommerce', | |
'driverOptions' => array( |
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 User; | |
use Base\Hydrator\Strategy\DateTimeStrategy; | |
use Zend\ModuleManager\Feature\AutoloaderProviderInterface; | |
use Zend\ModuleManager\Feature\FormElementProviderInterface; | |
use Zend\ModuleManager\Feature\ServiceProviderInterface; | |
use Zend\ModuleManager\Feature\ViewHelperProviderInterface; | |
use Zend\ModuleManager\ModuleManager; |
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
<link rel="import" href="../core-ajax/core-ajax.html"> | |
<link rel="import" href="../core-scaffold/core-scaffold.html"> | |
<link rel="import" href="../core-header-panel/core-header-panel.html"> | |
<link rel="import" href="../core-menu/core-menu.html"> | |
<link rel="import" href="../core-item/core-item.html"> | |
<link rel="import" href="../core-icon-button/core-icon-button.html"> | |
<link rel="import" href="../core-toolbar/core-toolbar.html"> | |
<link rel="import" href="../core-menu/core-submenu.html"> | |
<link rel="import" href="../google-map/google-map.html"> |
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
{ | |
"name": "zendframework/limpeza-facil", | |
"description": "E-commerce", | |
"authors": [ | |
{ | |
"name": "HorecioDias", | |
"email": "[email protected]" | |
} | |
], | |
"keywords": [ |
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
/** | |
* @return EntityManager | |
*/ | |
protected function getEm() | |
{ | |
if (null === $this->em) | |
$this->em = $this->getServiceLocator()->get('Doctrine\ORM\EntityManager'); | |
return $this->em; | |
} |
NewerOlder