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
WITH generate_date AS ( | |
SELECT CAST(RANGE AS DATE) AS date_key | |
FROM RANGE(DATE '2009-01-01', DATE '2013-12-31', INTERVAL 1 DAY) | |
) | |
SELECT date_key AS date_key, | |
DAYOFYEAR(date_key) AS day_of_year, | |
YEARWEEK(date_key) AS week_key, | |
WEEKOFYEAR(date_key) AS week_of_year, | |
DAYOFWEEK(date_key) AS day_of_week, | |
ISODOW(date_key) AS iso_day_of_week, |
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
parameters: | |
file_upload_mime_types: | |
- application/pdf | |
- application/x-pdf | |
- text/plain | |
- application/rtf | |
- image/* | |
- application/msword | |
- application/vnd.openxmlformats-officedocument.wordprocessingml.document |
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 | |
/** | |
* Get font awesome file icon class for specific MIME Type | |
* @see https://gist.github.com/guedressel/0daa170c0fde65ce5551 | |
* | |
*/ | |
function ($mime_type) { | |
// List of official MIME Types: http://www.iana.org/assignments/media-types/media-types.xhtml | |
$icon_classes = array( |
First of all, ensure you don't have any deprecated!
The Symfony documentation explains it well, but let's sum up:
- install the phpunit bridge (
$ composer require --dev symfony/phpunit-bridge
) - also check all your pages using web profiler and be ensure there is no
deprecation error
handled - found errors and need help about how to fix it ? I did a sort of guide.
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
git clone https://github.com/symfony-cmf/cmf-sandbox.git | |
cd cmf-sandbox | |
composer install | |
# declare optional extensions as required | |
php -dmemory_limit=4G $(which composer) require "ext-gd:*" "ext-exif:*" | |
git add composer.json composer.lock | |
git commit -m "require gd and exif extensions" | |
# add DATABASE_URL mapping to composer.json and update DB config (see database.diff) | |
php -dmemory_limit=4G $(which composer) update --lock | |
git add composer.json composer.lock app/config/config.yml app/config/config_prod.yml |
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
class MoneyType extends AbstractType implements DataMapperInterface | |
{ | |
public function buildForm(FormBuilder $builder, array $options) | |
{ | |
$builder | |
->add('amount', 'integer') | |
->add('currency', 'string') | |
->setDataMapper($this) | |
; | |
} |
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
# do it once | |
seq 1 | parallel -n0 "curl -H 'Content-Type: application/json' http://httpbin.org/post -X POST -d '{\"url\":\"http://google.com/\"}'" | |
# do it twice | |
seq 2 | parallel -n0 "curl -H 'Content-Type: application/json' http://httpbin.org/post -X POST -d '{\"url\":\"http://google.com/\"}'" | |
# do it 4 times, but at 2 a time | |
seq 4 | parallel -n0 -j2 "curl -H 'Content-Type: application/json' http://httpbin.org/post -X POST -d '{\"url\":\"http://google.com/\"}'" | |
# you can also put all your commands into a file |
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\AwesomeApp\Infrastructure\UserBundle\Features\Context; | |
use Behat\Behat\Context\Context; | |
use Behat\Behat\Context\Environment\InitializedContextEnvironment; | |
use Behat\Behat\Context\SnippetAcceptingContext; | |
use Behat\Behat\Hook\Scope\BeforeScenarioScope; | |
use Acme\AwesomeApp\Domain\User\Entity\User; | |
use Acme\AwesomeApp\Domain\User\Security\PasswordEncoder; |
In this tutorial we are going to show how easy it is to build a notification feed using GetStream.io. First of all, let's quickly introduce you to our fictional example app. It's called bug-your-friends.com and allows you interact with your friends, ping them, follow them or poke them. Here's a quick list of example interactions:
- poke another user (eg. Thierry pokes Alessandra)
- follow a user (eg. Tommaso follows Iris)
- ping a user (eg. Josie pings Carolina)
Whenever a user is part of one of these interactions, we want to update his notification feed, update the number of unseen and unread
NewerOlder