Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View anyt's full-sized avatar

Andrii Yatsenko anyt

View GitHub Profile
// примеры команд, которые выполняются при успешном сабмите формы
$.ajaxFormCommands = {
redirect: function (target) {
window.location.href = target;
},
reload: function () {
location.reload();
},
replace: function (newContent, target) {
"repositories": [
{
"type":"package",
"package": {
"name": "l3pp4rd/doctrine-extensions",
"version":"master",
"source": {
"url": "https://github.com/l3pp4rd/DoctrineExtensions.git",
"type": "git",
"reference":"master"
#common
alias h='history'
alias hg='history|grep'
alias g='grep'
# file system
alias ls='ls -GFh'
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
<?php
use Express\Application;
use Symfony\Component\HttpFoundation\Request;
$app = new Application();
//REST API example
$app->match(
'/user',
// Ctrl is mapped to the Alt keys, Alt to the Win keys, and Win to the Ctrl keys.
partial modifier_keys
xkb_symbols "ctrl_alt_win" {
key <LALT> { [ Control_L, Control_L ] };
modifier_map Control { <LALT> };
key <PRSC> { type[Group1] = "ONE_LEVEL",
symbols[Group1] = [ Super_R ] };
};
$collectionHolder = $('#tags');
$addTagLink = $('#add-tag');
function addTagForm($collectionHolder, ) {
// Get the data-prototype explained earlier
var prototype = $collectionHolder.data('prototype');
// get the new index
var index = $collectionHolder.data('index');
#!/bin/bash
sudo apt-get install apache2 php5 mysql-server libapache2-mod-php5 php5-mysql php5-sqlite php5-intl php5-cli php-apc php5-xdebug acl git
## configuration apache
sudo sed -i 's#/var/www#/vagrant#g' /etc/apache2/sites-available/default
sudo adduser www-data vagrant
## config php apache DEV
<?php
use FOS\RestBundle\Controller\Annotations\View;
use FOS\RestBundle\Controller\Annotations\Post;
use FOS\RestBundle\Controller\Annotations\Get;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Nelmio\ApiDocBundle\Annotation\ApiDoc;
class Controller {
/**
<?php
class A {
protected $kernel;
public function handle() {
print 1;
}
<?php
class ManyToManyTest extends \PHPUnit_Framework_TestCase
{
public function testSynchronization()
{
$post = new Post();
$tag = new Tag();
$post->addTag($tag);