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
/** | |
* @Route("/sandbox/insert-test") | |
* @Template() | |
*/ | |
public function insertTestAction() { | |
$em = $this->getDoctrine()->getEntityManager(); | |
$datetime = new \DateTime(); | |
$qtty = 4000; |
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
/** | |
* @param string $blockSlug | |
* @return \Rocket\BraPrintBundle\Entity\CmsBlock | |
*/ | |
public function getBlock($blockSlug) { | |
$result = ''; | |
$repo = $this->getEntityManager()->getRepository('RocketBraPrintBundle:CmsBlock'); | |
$item = $repo->findOneBySlug($blockSlug); | |
if ($item instanceof CmsBlock) { |
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
1) Criar uma entidade chamada StaticFile, com os atributos: | |
- original_name | |
- content_type | |
- slug | |
- size | |
2) Alterar a entidade CmsBlock, adicionando o atributo: | |
- is_published | |
3) Criar um novo botão no editor TinyMCE, que chamará um popup de upload de imagens |
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 | |
use Symfony\Component\Console\Input\ArrayInput; | |
use Behat\Behat\Console\BehatApplication; | |
use Symfony\Component\Console\Output\ConsoleOutput; | |
class BehatTest extends \PHPUnit_Framework_TestCase | |
{ | |
public function testThatBehatScenariosMeetAcceptanceCriteria() | |
{ |
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
protected function loadConnections(array $connections, ContainerBuilder $container) | |
{ | |
$cons = array(); | |
foreach ($connections as $name => $connection) { | |
// Define an event manager for this connection | |
$eventManagerId = sprintf('doctrine_mongodb.odm.%s_connection.event_manager', $name); | |
$container->setDefinition($eventManagerId, new DefinitionDecorator('doctrine_mongodb.odm.connection.event_manager')); | |
$configServiceName = sprintf('doctrine_mongodb.odm.%s_configuration', $name); |
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
#!/bin/bash | |
if [ $1 ] && [ $1 == '-h' ] | |
then | |
echo "" | |
echo "Welcome to Filebot AMC (Automated Media Center) Script." | |
echo "" | |
echo "Usage: filebot-amc.sh [torrent_name] [/path/to/torrent] [/path/to/media] [/path/to/log]" | |
echo "" | |
echo "NOTES: " |
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
package main | |
import "fmt" | |
type Foo struct { | |
what string | |
howMany int | |
} | |
type Bar struct { |
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
# TDD | |
function tdd { | |
pathToTestRunner=$1 | |
filesToWatch=$2 | |
if [[ -z $pathToTestRunner ]] | |
then | |
pathToTestRunner="vendor/bin/phpunit" | |
fi |
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 | |
// Usage : | |
// php fly.php <start_date> <trip_interval> <variance> <from> <to> | |
// | |
// Eg: A 7 day trip from VIX to STOC, 30 days of variance | |
// php fly.php 2015-07-01 30 "+7 day" vix stoc | |
$start = new \DateTime("{$argv[1]}"); | |
$variance = "+{$argv[2]} day"; |
OlderNewer