- Keeping DOM ready
- DOM utilities
- Modern AJAX (fetch) polyfill
- Promises right now and till the end
- Animations: Velocity, Move.js, Awesome JavaScript collection
- You Might Not Need jQuery Plugins collection
To be continued...
| <?php | |
| class SomeEntityRepository extends EntityRepository | |
| { | |
| public function findThis() | |
| { | |
| // method body | |
| } | |
| public function findThat() |
| <?php | |
| // composer require google/apiclient | |
| require __DIR__ . '/vendor/autoload.php'; | |
| // This is the file obtained from Google during the service account creation process | |
| // see these links: | |
| // 1. https://console.developers.google.com/apis/credentials/serviceaccountkey | |
| // 2. https://console.developers.google.com/iam-admin/serviceaccounts/create |
| <?php | |
| class MakeCoolStuff extends AbstractController | |
| { | |
| public function __construct( | |
| EntityManagerInterface $manager, | |
| YourFunkyService $service | |
| ) { | |
| $this->manager = $manager; | |
| $this->service = $service; |
| <?php | |
| // YourVendor/YourPackage/Behat/Legacy/ClassLoader.php | |
| declare(strict_types=1); | |
| namespace YourVendor\YourPackage\Behat\Legacy; | |
| use Symfony\Component\ClassLoader\ClassLoader as SymfonyClassLoader; | |
| try { | |
| require_once 'path/to/vendor/symfony/class-loader/ClassLoader.php'; |
| <?php | |
| public function onKernelRequest(GetResponseEvent $event) | |
| { | |
| if (!$event->isMasterRequest()) { | |
| return; | |
| } | |
| if ($this->isMaintenanceMode() && !$this->isUserAdmin()) { | |
| $event->setResponse($this->renderMaintenanceView()); |
| # Inspired from http://blog.hio.fr/2011/09/17/doctrine2-yaml-mapping-example.html | |
| MyEntity: | |
| type: entity | |
| repositoryClass: MyRepositoryClass | |
| table: my_entity | |
| namedQueries: | |
| all: "SELECT u FROM __CLASS__ u" | |
| # Class-Table-Inheritance |
| //- As you may know, Laravel 5 provides the Elixir to compile assets with no pain. | |
| These mixins is for those of you who want to use Jade power combined with that of Laravel Blade. | |
| The syntax mimic Blade statements, however identation differs in some cases. | |
| - var newline = "\r\n" | |
| - var loopIterator = '$iterator' | |
| //- @extends mixin | |
| Example: +extends('layouts/master') | |
| Compiled: @extends('layouts/master') |
| // Here's an example of using EpicEditor with something like Twitter Bootstrap tabs. | |
| // Thing is that EpicEditor doesn't calculate its dimensions properly when it is nested in a hidden container. | |
| // So, we just need to call 'reflow' method of the EpicEditor. Here is the simple solution: | |
| // Tab link that's clicked | |
| $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) { | |
| // EpicEditor instance recalculates its dimensions. | |
| editor.reflow(); | |
| }); |
| $languages = array('nl','fr'); | |
| $locale = Request::segment(1); | |
| if(in_array($locale, $languages)) | |
| { | |
| \App::setLocale($locale); | |
| } | |
| else | |
| { | |
| $locale = null; |