Skip to content

Instantly share code, notes, and snippets.

View wodor's full-sized avatar

Artur 'Wodor' Wielogorski wodor

View GitHub Profile
$file_display = new stdClass();
$file_display->api_version = 1;
$file_display->name = 'video__media_large__file_field_mediaelement_video';
$file_display->weight = 0;
$file_display->status = TRUE;
$file_display->settings = array(
'controls' => 1,
'width' => '1033',
'height' => '768',
'download_link' => 0,
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:cc="urn:ebay:apis:CoreComponentTypes" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext" xmlns:ed="urn:ebay:apis:EnhancedDataTypes" xmlns:ebl="urn:ebay:apis:eBLBaseComponents" xmlns:ns="urn:ebay:api:PayPalAPI">
<SOAP-ENV:Header>
<Security xmlns="http://schemas.xmlsoap.org/ws/2002/12/secext" xsi:type="wsse:SecurityType">
</Security>
<RequesterCredentials xmlns="urn:ebay:api:PayPalAPI" xsi:type="ebl:CustomSecurityHeaderType">
<Credentials xmlns="urn:ebay:apis:eBLBaseComponents" xsi:type="ebl:UserIdPasswordType">
@wodor
wodor / security
Created February 19, 2012 23:43
FacebookAuth
facebook:
pattern: ^/
fos_facebook:
app_url: "http://apps.facebook.com/motowypadypl/"
server_url: "http://motowypady.pl/"
default_target_path: /
provider: my_fos_facebook_provider
anonymous: true
logout:
handlers: ["fos_facebook.logout_handler"]
@wodor
wodor / LoadAdData.php
Created February 14, 2012 12:55
doctrine bathcing
<?php
/**
* Created by JetBrains PhpStorm.
* User: wodor
* Date: 13.02.12
* Time: 23:27
* To change this template use File | Settings | File Templates.
*/
use Doctrine\Common\DataFixtures\FixtureInterface;
@wodor
wodor / config
Created January 31, 2012 15:40
config_yml
parameters:
translator.class: WodorNet\MotoTripBundle\Service\Translator
@wodor
wodor / MotoTripExtensionTest.php
Created January 16, 2012 19:15
strange bahavior of \DateInterval::format("%a:)
$now = new \DateTime();
$before = new \DateTime('-2 days');
$intervalFromDiff = $before->diff($now);
$intervalFromConstruct= new \DateInterval("P2D");
$intervalFromString= \DateInterval::createFromDateString("2 days");
echo "\n a:".$intervalFromString->format("%a");
echo "\n a:".$intervalFromDiff->format("%a");
echo "\n a:".$intervalFromConstruct->format("%a");
@wodor
wodor / TripController
Created January 11, 2012 18:39
getting username of entity, Entry->mask tells permission type
$aclProvider = $this->get('security.acl.provider');
$firstAce = current($aclProvider->findAcl(ObjectIdentity::fromDomainObject($entity))->getObjectAces());
$username = $firstAce->getSecurityIdentity()->getUsername();
@wodor
wodor / ServiceContainerFactory.php
Created August 19, 2011 12:31
ServiceContainerFactory
<?php
class ServiceContainerFactory {
private static $instances = array();
private static $coreSiteId = null;
/**
* Site id po raz pierwszy użyty implikuje późniejszy domyślny siteId
* @param int $siteId