Skip to content

Instantly share code, notes, and snippets.

View richsage's full-sized avatar

Rich Sage richsage

View GitHub Profile

Keybase proof

I hereby claim:

  • I am richsage on github.
  • I am richsage (https://keybase.io/richsage) on keybase.
  • I have a public key whose fingerprint is 3039 674C 2D35 46F5 9FF1 FE1D 792D C359 F082 396B

To claim this, I am signing this object:

Here are some tips to help print your music successfully: (It is very important that you follow these steps from start to finish before attempting to print again)

  1. Restart your computer and printer.
  2. Use the most up to date Internet Explorer, Safari, or Mozilla Firefox.
  3. Close all other applications.
  4. Delete cookies and cache memory. (Simple guides can be located in google.)
  5. Uninstall and reinstall the recommended software. ( Adobe Air, Adobe Flash, and SMP Application)
<?php
// Acme\DemoBundle\Twig\GravatarExtension
namespace Acme\DemoBundle\Twig;
class GravatarExtension extends \Twig_Extension
{
private $secure_request = false;
@richsage
richsage / gist:818639
Created February 9, 2011 15:25
RequiredLabelsFormatterTable.class.php
<?php
class RequiredLabelsFormatterTable extends sfWidgetFormSchemaFormatterTable
{
protected $requiredLabelClass = 'required';
/**
* Generates a label, but adds a '*' if the field is required
* @see sfWidgetFormSchemaFormatter::generateLabel()
*/
@richsage
richsage / gist:818641
Created February 9, 2011 15:26
BaseForm.class.php
<?php
/**
* Base project form.
*
* @package sbtickets
* @subpackage form
* @author Your name here
* @version SVN: $Id: BaseForm.class.php 20147 2009-07-13 11:46:57Z FabianLange $
*/
@richsage
richsage / gist:1016489
Created June 9, 2011 10:27
Behat, FOS FacebookBundle
Feature: Register with MyApp with a Facebook account
As a Facebook user
I want to register with MyApp
In order to do awesome stuff
Scenario: Susan Smith logs into MyApp
Given I am logged in as Susan Smith on Facebook
When I click sign in with facebook
Then I am asked to authorise the MyApp facebook app
And I should be redirected to the MyApp profile page
@richsage
richsage / gist:1069251
Created July 7, 2011 10:22
Behat step for logging in
$steps->Given('/^I am logged into the admin area as rich_81$/', function($world) {
$session = $world->getSession();
$doc = $session->getPage();
// Ensure we're logged out for cases where the session isn't
// reset between Behat steps
$session->visit($world->locatePath("/admin/logout"));
$session->visit($world->locatePath("/admin"));
@richsage
richsage / AccessController.php
Created July 19, 2011 14:33
FOSFacebookBundle woes (updated, using my own provider, same issue)
// assume all generic use statements up here for Controller, RedirectResponse etc
class AccessController extends Controller
{
/**
* Called when a user attempts to sign in with facebook
*
* @Route("/signin/facebook", name="signin_facebook")
* @return \Symfony\Bundle\FrameworkBundle\Controller\Response
*/
security:
providers:
my_facebook_provider:
id: my.facebook.user
my_normaluser_provider:
id: my.normal.user
firewalls:
public:
pattern: ^/.*
anonymous: ~
services:
my.twig.helperextension:
class: My\OwnBundle\Twig\Extension\MyHelperExtension
tags:
- { name: twig.extension, alias: myhelperextension }
my.notificationsextension:
class: My\OwnBundle\Twig\Extension\NotificationsExtension
arguments:
container: "@service_container"
context: "@security.context"