Skip to content

Instantly share code, notes, and snippets.

class MyCode
{
private function option1()
{
$this->notMyCode->doSomething(function () {
// dużo logiki, 100 linii, trudne do przetestowania, etc, więc odpada
});
}
private function option2()
<?php
class MyCode
{
private function option1()
{
$this->notMyCode->doSomething(function ($value) {
return strlen($value);
});
}
<?php
/**
* Model szkieletor:
* struktura danych co nie ma żadnej logiki, żadnej enkapsulacji,
* korzystający może z tym obiektem zrobić co tylko zechce.
*/
class BadEntity
{
private $username;
<?php
class ShopOpenings
{
/**
* @var array
*/
private $config;
/**
{% form_theme form with [_self, 'form_table_layout.html.twig'] %}
{% block _field_that_should_be_hidden_row %}
{{ block('hidden_row') }}
{% endblock %}
<?php
class FormController
{
public function formAction()
{
$form = $this->createFormBuilder()
->add('something_at', 'datetime', [
'date_widget' => 'single_text',
'time_widget' => 'single_text',
`/Applications/Colobot.app/Contents/MacOS/colobot --language=pl`
/\ This opens the polish translation of http://colobot.info/
How do I set this pernamently, so that double-clicking `Colobot.app` opens the polish version?
<project name="blabla">
<condition property="composerDoesNotExist">
<not>
<available file="${basedir}/bin/composer.phar" />
</not>
</condition>
<target name="composer-download" description="Downloading Composer" if="composerDoesNotExist">
<mkdir dir="${basedir}/bin" />
@MacDada
MacDada / gist:1919306
Created February 26, 2012 22:12
My Symfony2 projects .gitignore file
#### OSX etc ####
.DS_Store*
Icon?
Thumbs.db
ehthumbs.db
*.swp
*.out
/nbproject/
*.lock
*~
<?php
$cacheId = 'xyz';
$cacheDriver = new \Doctrine\Common\Cache\ApcCache();
if ($cacheDriver->contains($cacheId)) {
return $cacheDriver->fetch($cacheId);
}