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
| <script type="text/javascript" src="{{ asset('/bundles/fosjsrouting/js/router.js') }}"></script> | |
| {% if _env == 'prod' %} | |
| <script type="text/javascript" src="{{ asset('/js/fos_js_routes.js') }}"></script> | |
| {% else %} | |
| <script type="text/javascript" src="{{ path('fos_js_routing_js', {"callback": "fos.Router.setData"}) }}"></script> | |
| {% endif %} |
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 | |
| $filter = 'foo'; | |
| $qb = $this->getEntityManager()->createQueryBuilder(); | |
| $qb->select('u'); | |
| $qb->from($this->getClassName() , 'u'); | |
| $qb->add('where', $qb->expr()->orx( | |
| $qb->expr()->like('u.email', $qb->expr()->literal('%'.$filter.'%')), |
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/sh | |
| echo "cache..." | |
| php app/console cache:clear --env=dev | |
| php app/console cache:clear --env=prod | |
| echo "doctrine..." | |
| php app/console doctrine:cache:clear-metadata |
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
| services: | |
| session.metadata_bag: | |
| class: Symfony\Component\HttpFoundation\Session\Storage\MetadataBag | |
| arguments: | |
| - '_sf2_meta' | |
| - '0' | |
| public: false | |
| session.file_handler: | |
| class: Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeFileSessionHandler | |
| arguments: |
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
| http { | |
| map $http_user_agent $limit_bots { | |
| default ''; | |
| ~*(google|bing|yandex|msnbot) $binary_remote_addr; | |
| } | |
| limit_req_zone $limit_bots zone=bots:10m rate=1r/m; | |
| server { |
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
| alias l='ls -alF' | |
| alias la='ls -A' | |
| alias ll='ls -CF' | |
| alias gittree='git log --pretty=format:"%h - %an, %ar : %s" --graph' |
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
| Article: | |
| manyToMany: | |
| tags: | |
| targetEntity: Tag | |
| inversedBy: articles | |
| joinTable: | |
| name: tags_for_articles | |
| joinColumns: | |
| article_id: | |
| referencedColumnName: 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
| sudo mkdir /etc/nginx/ssl && cd /etc/nginx/ssl | |
| sudo openssl genrsa -des3 -out server.key 1024 | |
| sudo openssl req -new -key server.key -out server.csr | |
| sudo cp server.key server.key.org | |
| sudo openssl rsa -in server.key.org -out server.key | |
| sudo openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt | |
| echo "add these lines into your nginx host config" | |
| echo " ssl on;" | |
| echo " ssl_certificate /etc/nginx/ssl/server.crt;" | |
| echo " ssl_certificate_key /etc/nginx/ssl/server.key;" |
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 | |
| function ordinal($cdnl){ | |
| $test_c = abs($cdnl) % 10; | |
| $ext = ((abs($cdnl) %100 < 21 && abs($cdnl) %100 > 4) ? 'th' | |
| : (($test_c < 4) ? ($test_c < 3) ? ($test_c < 2) ? ($test_c < 1) | |
| ? 'th' : 'st' : 'nd' : 'rd' : 'th')); | |
| return $cdnl.$ext; | |
| } |