Skip to content

Instantly share code, notes, and snippets.

View tarlepp's full-sized avatar
💭
örrr

Tarmo Leppänen tarlepp

💭
örrr
  • Pinja
  • Jyväskylä, Finland
View GitHub Profile
<?php
namespace App\Controller;
use App\UseCases\UserManagement;
use App\UseCases\UserManagementInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Routing\Annotation\Route;
class UserManagementController extends AbstractController
<?php
namespace AppBundle\DependencyInjection\Compiler;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
class OverrideServiceCompilerPass implements CompilerPassInterface
{
private $environment;
#index:
# path: /
# controller: App\Controller\DefaultController::index
logout:
path: /logout
# you can read more about security in the related section of the documentation
# http://symfony.com/doc/current/book/security.html
security:
# http://symfony.com/doc/current/book/security.html#where-do-users-come-from-user-providers
providers:
our_db_provider:
entity:
class: GASUserBundle:User
property: username
@tarlepp
tarlepp / README.md
Last active August 27, 2017 15:00 — forked from gaby-de-wilde/README.md
Even Shorter Syndication [ESS] Node.js module

The module returns the ESS and has 2 arguments:

1 - the link to the RSS or Atom feed described. 2 - An array of objects formatted like this:

[
  { pubDate: 1503674340000, title: "hello world"},
  { pubDate: 1503674220000, title: "foo"        },
  { pubDate: 1503674160000, title: "bar"        }
<?php
class FooController
{
public function indexAction(Request $request, UserData $userDataService): Response
{
$username = 'someuser';
$foo = $userDataService->checkUser($username);
parameters:
class: Home\PageBundle\Entity\Box
services:
box_form:
class: Symfony\Component\Form\Form
factory: ['@form.factory', create]
arguments:
- Home\PageBundle\Form\BoxType
<?php
namespace Home\PageBundle\Handler;
use Symfony\Component\Form\Form;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RequestStack;
class BoxHandler
{
/**
* UserProductsController
*
* @description :: Server-side logic for managing Userproducts
* @help :: See http://sailsjs.org/#!/documentation/concepts/Controllers
*/
module.exports = {
yourAction: function(req, res) {
sails.models.product.find().sort('heat ASC').exec(function (err, products){
passport.serializeUser(function (user, next) {
next(null, user.id);
});
passport.deserializeUser(function (id, next) {
sails.models.user.findOne(id)
.populate('products')
.exec(next);
});