Skip to content

Instantly share code, notes, and snippets.

@fnordo
fnordo / gist:9325499
Created March 3, 2014 14:01
example-array
array(
foo__id => 1,
foo__title => "foo",
bar__id => 2,
bar__test => "aha"
)
@fnordo
fnordo / activity-test.php
Created June 7, 2013 10:41
timeline-activity-example
// ControllerAction
public function createControlsTheWorlddActivityAction($id)
{
$subject = $this->actionManager->findOrCreateComponent('Acme\Entity\Page', $id);
$action = $this->actionManager->create($subject, 'controls', array('directComplement' => 'the world'));
$this->actionManager->updateAction($action);
$activities = $this->actionManager->getSubjectActions($subject);
@fnordo
fnordo / gist:5683701
Last active December 17, 2015 22:39
php-soap-test
$location = 'http://footballpool.dataaccess.eu/data/info.wso';
$uri = 'http://footballpool.dataaccess.eu';
$options = array(
'location' => $location,
'uri' => $uri
);
try {
$client = new SoapClient(null, $options);
print(
$client->__soapCall('TopGoalScorers', array('iTopn' => 5))
@fnordo
fnordo / gist:5115371
Last active December 14, 2015 16:29
LInk-With-Background-Image-Example
HTML:
<a class="foobar" href="http://somewebsite.com" target="_blank"></a>
CSS:
a.foobar {
display: block;
width: give-it-some-width
height: give-it-some-height
background: url("path/to/image") no-repeat;
}
@fnordo
fnordo / slide-elem-with-gallery-example
Last active December 14, 2015 08:08
Simply use the HTML-markup and you should be good to go...
################## MARKUP HTML LAYOUT ###################
<body>
<div id="site" class="container">
<div id="layout-full">
<div id="page-container" class="container"></div>
</div>
<div id="layout-2-col" class="row">
<div id="sidebar-2-col" class="span6"></div>
<div id="content-2-col" class="span12"></div>
</div>
@fnordo
fnordo / gist:3865266
Created October 10, 2012 12:22
Example BackboneView
PageView = Backbone.View.extend({
initialize: function(){
// If model has changed, update view accordingly:
this.model.bind("change", this.render, this);
},
render: function(evt){console.warn('called: view::render');
/*
* Normally we maybe would/could do something like this, but
* how can we update the View if we have initialized it with
* an already rendered markup instead of a template?
@fnordo
fnordo / gist:3865247
Created October 10, 2012 12:19
template rendered on server
## BEGIN: Template (rendered on serverside) ###
<div id="wrap_page_view">
<h1>Title</h1>
<p>
Description: lorem foobar...
</p>
</div>
<script type="text/javascript">
<div id="field_container_s4fda1a9360862_partners">
<span id="field_widget_s4fda1a9360862_partners" >
</span>
<span id="field_actions_s4fda1a9360862_partners" >
<a
href="/app_dev.php/admin/dubture/plansinn/projecthaspartner/create?uniqid=s4fda1ac37ce8f&amp;code=sonata.admin.projecthaspartner&amp;pcode=sonata.admin.project&amp;puniqid=s4fda1a9360862"
onclick="return start_field_retrieve_s4fda1a9360862_partners(this);"
sonata_media:
db_driver: doctrine_orm
default_context: default
contexts:
default: # the default context is mandatory
providers:
- sonata.media.provider.file
formats:
small: { width: 100 , quality: 100}