This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* should behave like LocalStorage | |
*/ | |
var inMemoryStorage = (function () { | |
var items = {}; | |
return { | |
length: 0, // todo: read only | |
getItem: function (key) { | |
return 'undefined' !== typeof items[key] ? items[key] : null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project name="NazwaProjektu" default="lint"> | |
<target name="lint" description="Sprawdzamy poprawność składni PHP (syntax check)"> | |
<apply executable="php" failonerror="true"> | |
<arg value="--syntax-check" /> | |
<fileset dir="${basedir}"> | |
<include name="**/*.php" /><!-- sprawdzaj wszystkie pliki php --> | |
<exclude name="PominTenFolder/**/*" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Updatable | |
{ | |
private $field1; | |
private $field2; | |
public function __construct($field1, $field2) | |
{ | |
$this->field1 = $field1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
`/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? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class FormController | |
{ | |
public function formAction() | |
{ | |
$form = $this->createFormBuilder() | |
->add('something_at', 'datetime', [ | |
'date_widget' => 'single_text', | |
'time_widget' => 'single_text', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class ShopOpenings | |
{ | |
/** | |
* @var array | |
*/ | |
private $config; | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class MyCode | |
{ | |
private function option1() | |
{ | |
$this->notMyCode->doSomething(function ($value) { | |
return strlen($value); | |
}); | |
} |