The popular open-source contract for web designers and developers by Stuff & Nonsense
- Originally published: 23/12/2008
- Revised date: 15/12/2013
- Original post
| http { | |
| client_max_body_size 20M; | |
| upstream influxdb { | |
| server server1:8086; | |
| server server2:8086; | |
| } | |
| upstream relay { | |
| server server1:9096; | |
| server server2:9096; |
| locations: | |
| nxvl_7hetf84txck7: | |
| location: '~ ^/(js|css|images|fonts)' | |
| gzip_static: on | |
| expires: 30d | |
| add_header: 'Cache-Control public' | |
| add_header: 'Last-Modified ""' | |
| add_header: 'ETag ""' | |
| access_log: off |
| class SudoListener { | |
| public function onKernelController(FilterControllerEvent $event) { | |
| $controller = $event->getController(); | |
| $token = $this->tokenStorage->getToken(); | |
| if ($token === null || ($user = $token->getUser()) === null) { | |
| return; | |
| } | |
| if (!is_array($controller)) { |
| # Create a new Token | |
| curl -u 'githubuser' -d '{"note":"Your Application"}' https://api.github.com/authorizations | |
| # It is: "ebab4dc37e654bb230a9c69ebcd5f38e9a81e210" | |
| #{ | |
| # "created_at": "2013-01-04T18:00:28Z", | |
| # "app": { | |
| # "url": "http://developer.github.com/v3/oauth/#oauth-authorizations-api", |
| <?php | |
| namespace NationalNet\MynatnetBundle\Security\Authentication\Handler; | |
| use NationalNet\MynatnetBundle\Manager\UserManager; | |
| use Symfony\Component\HttpFoundation\RedirectResponse; | |
| use Symfony\Component\HttpFoundation\Request; | |
| use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; | |
| use Symfony\Component\Security\Http\Authentication\AuthenticationSuccessHandlerInterface; |
| var querystring = require('querystring'); | |
| var http = require('http'); | |
| var fs = require('fs'); | |
| var requester = require('request'); | |
| var postData = querystring.stringify({ | |
| grant_type: "password", | |
| username: "your_email", | |
| password: "password", | |
| client_id: "ghost-admin" |
| // ---------------------------------------------------------- | |
| // A short snippet for detecting versions of IE in JavaScript | |
| // without resorting to user-agent sniffing | |
| // ---------------------------------------------------------- | |
| // If you're not in IE (or IE version is less than 5) then: | |
| // ie === undefined | |
| // If you're in IE (>=5) then you can determine which version: | |
| // ie === 7; // IE7 | |
| // Thus, to detect IE: | |
| // if (ie) {} |
| $builder->add('secretQuestion', 'entity', [ | |
| 'property' => 'question', | |
| 'class' => 'E:SecretQuestion', | |
| 'query_builder' => function(EntityRepository $er) { | |
| return $er->createQueryBuilder('q')->orderBy('q.id', 'ASC'); | |
| } | |
| ]); |