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
public class EmailAddressPartsExtractorTest { | |
private EmailAddressPartsExtractor extractor = new EmailAddressPartsExtractor(); | |
@Test | |
public void extractUsername() { | |
assertThat(extractor.extractUsername("[email protected]"), is("elnur.blog")); | |
} | |
@Test | |
public void extractHost() { |
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
shared_preload_libraries = 'auto_explain' | |
auto_explain.log_min_duration = 100 | |
auto_explain.log_analyze = true | |
auto_explain.log_verbose = true | |
auto_explain.log_nested_statements = true |
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
public function registerAction(Request $request) | |
{ | |
$user = new User(); | |
$form = $this->formFactory->create('user', $user); | |
$form->handleRequest($request); | |
if ($form->isValid()) { | |
$this->userManager->save($user); | |
// ... |
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
@Configuration | |
@EnableTransactionManagement | |
public class PersistenceConfig { | |
@Bean | |
public PlatformTransactionManager transactionManager() { | |
return new JpaTransactionManager(entityManagerFactory()); | |
} | |
// other bean definitions | |
} |
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
task apiTest(type: Test) { | |
useTestNG() | |
testClassesDir = sourceSets.apiTest.output.classesDir | |
classpath = sourceSets.apiTest.runtimeClasspath | |
doFirst { | |
tasks.tomcatRun.outputs.upToDateWhen { false } | |
tasks.tomcatRun.contextPath = '/' | |
tasks.tomcatRun.daemon = true |
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 Example\Repository\Doctrine\ORM; | |
use Example\Test\AbstractIntegrationTest; | |
use Example\Util\ModelFactory; | |
class CompanyRepositoryTest extends AbstractIntegrationTest | |
{ | |
/** | |
* @var CompanyRepository |
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
before "deploy:finalize_update" do | |
capifony_pretty_print "--> Update assets version" | |
run "if [ -f #{shared_path}/app/config/parameters.yml ]; then sed -i.bak 's/\\(assets_version:[[:space:]]*\\)[[:digit:]]*/\\1#{release_name}/' #{shared_path}/app/config/parameters.yml; fi" | |
capifony_puts_ok | |
end |
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 Example\Model; | |
use Doctrine\ORM\Mapping\Column; | |
use Doctrine\ORM\Mapping\Entity; | |
use Doctrine\ORM\Mapping\GeneratedValue; | |
use Doctrine\ORM\Mapping\Id; | |
/** | |
* @Entity |
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 Acme\Form\Extension; | |
use JMS\DiExtraBundle\Annotation\Service; | |
use JMS\DiExtraBundle\Annotation\Tag; | |
use Symfony\Component\Form\AbstractTypeExtension; | |
use Symfony\Component\Form\FormInterface; | |
use Symfony\Component\Form\FormView; | |
/** |
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
- hosts: all | |
serial: 1 | |
tasks: | |
- name: Reboot | |
command: /sbin/reboot removes=/var/run/reboot-required | |
- name: Wait for the server to reboot | |
local_action: wait_for host={{ inventory_hostname }} port=22 |
NewerOlder