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 | |
namespace AppBundle\Form\DataTransformer; | |
use AppBundle\Entity\Entity; | |
use AppBundle\Entity\EntityRepository; | |
use Symfony\Component\Form\DataTransformerInterface; | |
use Symfony\Component\Form\Exception\TransformationFailedException; | |
class EntitiesToIdsDataTransformer implements DataTransformerInterface |
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
/* | |
author: jbenet | |
os x, compile with: gcc -o testo test.c | |
linux, compile with: gcc -o testo test.c -lrt | |
*/ | |
#include <time.h> | |
#include <sys/time.h> | |
#include <stdio.h> |
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 | |
if (!class_exists('Imagick')) { | |
class Imagick | |
{ | |
const FILTER_LANCZOS = 1; | |
private $path; | |
public function __construct($path) |
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
{% extends 'MyBundle::layout.html.twig' %} | |
{% form_theme edit_form _self %} | |
{% set someVariable = 'abc' %} | |
{% block _myformname_myfield_widget %} | |
{{ block('form_widget') }} | |
{{ someVariable }} | |
{% endblock %} |
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
ko.bindingHandlers.canvasContext = { | |
init: function(element, valueAccessor, allBindingsAccessor, viewModel) { | |
if ("undefined" === typeof viewModel.__canvasContexts__) { | |
viewModel.__canvasContexts__ = []; | |
} | |
// works now :) | |
if ("function" !== typeof element.getContext && FlashCanvas) { | |
FlashCanvas.initElement(element); | |
} |
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
$('#form').submit(function() { | |
/* This is a callback that some lib file is doing before the form is submitted. | |
* My goal is not to modify it */ | |
}); |
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
(function(window) { | |
// is calling a function on this "local" window faster | |
window.parseInt("17"); | |
// then calling it as a global function? | |
parseInt("17"); | |
})(window); |
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; |