Skip to content

Instantly share code, notes, and snippets.

Configure

xdebug.ini

xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_port=9000
xdebug.remote_autostart=1
xdebug.remote_connect_back=1
@mikemadisonweb
mikemadisonweb / gulpfile.js
Created August 28, 2016 13:49 — forked from glebcha/gulpfile.js
Gulp task sample (css and js minify+concat, compress images, watching for changes)
// Определяем зависимости в переменных
var gulp = require('gulp'),
cache = require('gulp-cache'),
clean = require('gulp-clean'),
stream = require('event-stream'),
size = require('gulp-size'),
jshint = require('gulp-jshint'),
concat = require('gulp-concat'),
uglify = require('gulp-uglify'),
minifyCSS = require('gulp-minify-css'),
@mikemadisonweb
mikemadisonweb / Queue.class.php
Created August 24, 2016 13:24 — forked from zachflower/Queue.class.php
PHP implementation of a queue.
<?php
// http://www.cplusplus.com/reference/queue/queue/
class Queue {
private $_queue = array();
public function size() {
return count($this->_queue);
}
@mikemadisonweb
mikemadisonweb / Stack.class.php
Created August 24, 2016 13:24 — forked from zachflower/Stack.class.php
PHP implementation of a stack.
<?php
// http://www.cplusplus.com/reference/stack/stack/
class Stack {
private $_stack = array();
public function size() {
return count($this->_stack);
}
@mikemadisonweb
mikemadisonweb / BinarySearchTree.class.php
Created August 24, 2016 13:24 — forked from zachflower/BinarySearchTree.class.php
PHP implementation of a binary search tree.
<?php
class Node {
public $level = 1;
public $data = NULL;
public $left = NULL;
public $right = NULL;
public function __construct($data = NULL) {
$this->data = $data;
@mikemadisonweb
mikemadisonweb / LinkedList.class.php
Created August 24, 2016 13:23 — forked from zachflower/LinkedList.class.php
PHP implementation of a singly linked list.
<?php
class Node {
public $data = NULL;
public $next = NULL;
public function __construct($data = NULL) {
$this->data = $data;
}
}
@mikemadisonweb
mikemadisonweb / 1-Explanations.md
Created August 23, 2016 07:27 — forked from danvbe/1-Explanations.md
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.
@mikemadisonweb
mikemadisonweb / Paypal.php
Created August 23, 2016 07:26 — forked from danvbe/Paypal.php
Sonata PayPal issue fix
<?php
/**
* Created by PhpStorm.
* User: danvbe
* Date: 7/25/14
* Time: 2:49 PM
*/
namespace Application\Sonata\PaymentBundle\Component;
UPDATE TABLE_NAME
SET url_string=REPLACE(url_string, 'http://www.base_url.com/', '')
WHERE 1
<?php
/**The following class generates VALID RFC 4211 COMPLIANT Universally Unique IDentifiers (UUID) version 3, 4 and 5.
* Version 3 and 5 UUIDs are named based. They require a namespace (another valid UUID) and a value (the name). Given the same namespace and name, the output is always the same.
* Version 4 UUIDs are pseudo-random.
* UUIDs generated below validates using OSSP UUID Tool, and output for named-based UUIDs are exactly the same. This is a pure PHP implementation.
*/
class UUID {
public static function v3($namespace, $name) {
if(!self::is_valid($namespace)) return false;