Skip to content

Instantly share code, notes, and snippets.

@totophe
totophe / react-component-webstorm.js
Last active February 4, 2017 00:12
Webstorm file templates for react
import React, { Component } from 'react';
class ${NAME} extends Component {
constructor() {
super();
this.state = {
foo: 'bar',
};
}
@akre54
akre54 / .gitignore
Last active October 27, 2015 13:23
Backbone deps test
node_modules
out.js*
@nicolas-grekas
nicolas-grekas / speed.php
Created November 26, 2014 14:59
Speed PHP benchmark
<?php
$len = 1000000;
$a = range(1, $len);
$f = SplFixedArray::fromArray($a);
$s = microtime(1);
$i = $len;
@danvbe
danvbe / 1-Explanations.md
Last active July 23, 2025 05:55
A way to integrate FosUserBundle and HWIOAuthBundle

I have managed to install this… and make it work. I implemented it for Facebook and Google, but you can extend it. My solution it is mostly as described in #116, with a bit of more code presented. The key aspects that lack in the #116 presentation (IMO) are:

  • the registration as service of your custom FOSUBUserProvider (with the necessary parameters)
  • set the service for oauth_user_provider in the security.yml with your custom created service

Here are the steps:

  1. Routing. In routing.yml I have added all the routes for both bundles.
  2. Configuration. I have set the config.yml mostly as it is presented in the HWIOAuthBundle.
  3. Security. I have set the security.yml mostly as it is presented in the HWIOAuthBundle (though my routes are using /login pattern, not /connect). Also, the oauth_user_provider is set for my custom service.
@cbmd
cbmd / default.conf
Created December 9, 2012 21:13
nginx config - dynamic virtual hosts
server {
index index.php;
set $basepath "/var/www";
set $domain $host;
# check one name domain for simple application
if ($domain ~ "^(.[^.]*)\.dev$") {
set $domain $1;
set $rootpath "${domain}";