Skip to content

Instantly share code, notes, and snippets.

<header class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container-fluid">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<a class="brand" href="{{ path('tbs_formation_blog_posts_index') }}">Mon Blog</a>
@wpottier
wpottier / .git-completion.bash
Created July 2, 2012 08:21
.git-completion.bash
#!bash
#
# bash completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.
#
# The contained completion routines provide support for completing:
#
/**
* Get a user from the Security Context
*
* @return mixed
*
* @throws \LogicException If SecurityBundle is not available
*
* @see Symfony\Component\Security\Core\Authentication\Token\TokenInterface::getUser()
*/
public function getUser()
@wpottier
wpottier / BaseMailer.php
Created July 11, 2012 12:45
BaseMailer
<?php
namespace Mon\Site\BlogBundle\Mailer;
class BaseMailer {
protected $mailer;
protected $container;
public function __construct(\Symfony\Component\DependencyInjection\Container $container) {
$this->container = $container;
@wpottier
wpottier / gist:3097873
Created July 12, 2012 12:42
Modal bootstrap
<!-- Modal for view slide -->
<div class="modal hide" id="modal-edit-{{ post.id }}">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h3>Modifier</h3>
</div>
<div class="modal-body">
</div>
<div class="modal-footer">
@wpottier
wpottier / Symfony2CssRewriteFilter.php
Created September 5, 2012 09:18
Symfony2CssRewriteFilter
<?php
namespace Clever\Presenter\CoreBundle\Assetic\Filter;
use Assetic\Filter\BaseCssFilter;
use Assetic\Asset\AssetInterface;
/**
* Fixes relative CSS urls.
* Support of Symfony relative bundles url
/**
* @Route("/security/login",)
* @Template()
*/
public function loginAction() {
if ($this->get("security.context")->isGranted('IS_AUTHENTICATED_FULLY')) {
return $this->redirect($this->generateUrl('mon_site_blog_default_index'));
}
$request = $this->getRequest();
@wpottier
wpottier / CreateUserCommand.php
Created September 6, 2012 13:17
CreateUserCommand
<?php
namespace Mon\Site\UserBundle\Command;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Output\OutputInterface;
use Mon\Site\UserBundle\Entity as Entity;
@wpottier
wpottier / gist:3754978
Created September 20, 2012 09:48
form theme bootstrap
{# Widgets #}
{% block form_widget %}
{% spaceless %}
{{ block('field_rows') }}
{{ form_rest(form) }}
{% endspaceless %}
{% endblock form_widget %}
{% block collection_widget %}
#! /bin/sh
### BEGIN INIT INFO
# Provides: amazon-resque
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the amazon resque daemon
# Description: starts amazon resque using start-stop-daemon