Skip to content

Instantly share code, notes, and snippets.

View anyt's full-sized avatar

Andrii Yatsenko anyt

View GitHub Profile
<?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 {
/**
#!/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
$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');
// 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 ] };
};
<?php
use Express\Application;
use Symfony\Component\HttpFoundation\Request;
$app = new Application();
//REST API example
$app->match(
'/user',
#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'
"repositories": [
{
"type":"package",
"package": {
"name": "l3pp4rd/doctrine-extensions",
"version":"master",
"source": {
"url": "https://github.com/l3pp4rd/DoctrineExtensions.git",
"type": "git",
"reference":"master"
// примеры команд, которые выполняются при успешном сабмите формы
$.ajaxFormCommands = {
redirect: function (target) {
window.location.href = target;
},
reload: function () {
location.reload();
},
replace: function (newContent, target) {
@anyt
anyt / composer.json
Created January 22, 2014 22:54
add jquery and jquery ui to composer
"repositories": [
{
"type": "package",
"package": {
"name": "jquery/jquery",
"version": "1.10.2",
"dist": {
"url": "http://code.jquery.com/jquery-1.10.2.js",
"type": "file"
}
<?php
require 'vendor/autoload.php';
// Create the mail transport configuration
$transport = Swift_MailTransport::newInstance();
// Create the message
$message = Swift_Message::newInstance();
$message->setTo(array(