Skip to content

Instantly share code, notes, and snippets.

View kix's full-sized avatar

Stepan Anchugov kix

View GitHub Profile
{% extends "form_div_layout.html.twig" %}
{# Widgets #}
{% block form_widget_simple %}
{% spaceless %}
{% set type = type|default('text') %}
{% if attr.class is defined and not "form-control" in attr.class %}
{% set attr = attr|merge({class: attr.class ~ ' form-control'}) %}
{% elseif attr.class is not defined %}
<?php
/**
* WebTestCase client-aware test case
*/
trait ClientAware
{
/**
* @var \Symfony\Bundle\FrameworkBundle\Client
*/
private $client;
@kix
kix / GoodSEO.feature
Created May 20, 2013 08:43
Automated SEO checking!
Feature: Good SEO
As a worried customer
I expect my SEO to be good
Scenario: My SEO is good
When I search for "скачать бесплатно без регистрации и смс" on "http://google.com"
Then my shitty website should be at least on the "4"th line
@kix
kix / composer.json
Created May 16, 2013 06:18
JMSTranslationBundle issue
{
"name": "symfony/framework-standard-edition",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
"psr-0": { "": "src/" }
},
"require": {
"php": ">=5.3.3",
"symfony/symfony": "2.2.0",
<?php
/**
* @Route("/users")
* @UseEntities({"users": "My\Bundle\Entity\User"})
*/
class UsersController extends Controller
{
/**
* @Route("/show", name="front_users_show")
@kix
kix / deploy.rb
Created October 18, 2012 16:47
Yii Capistrano recipe
set :application, "AppName"
set :repository, "[email protected]:path/toRepo.git"
set :deploy_to, "/app/appname"
set :deploy_via, :copy
set :stage_dir, "config/stages"
set :current_dir , "www"
set :default_stage, "dev"
set :stages, %w(dev testing prod)
set :use_sudo, false
@kix
kix / silex-sf2-controllers.rst
Created October 16, 2012 04:29
How to use controllers like in Symfony2 framework

How to use controllers like in Symfony2 framework

In Silex, the most common way to define the controller of a route is with a closure. But when your project gets bigger, you want to organize your code in classes. You can use the syntax ClassName::methodName in your route definition instead of a function () { ... } but you have to inject the Silex\Application $app as a parameter on each method of your controller class, which can become quite boring.

@kix
kix / db_dumper.rb
Created October 10, 2012 18:50
Old Capistrano DB sync recipe
# tasks for dumping your production db
set :domain, "example.com"
set :user, "deploy"
set :database_username, "root"
set :database_password, ""
namespace :db_dumper do
desc "Exports the production db to the home directory of user"
task :mysql_dump, :roles => [:db], :only => { :primary => true } do
@kix
kix / cap.rb
Created October 5, 2012 08:04
Capistrano cheat sheet
http://www.dizzy.co.uk/cheatsheets
This work is licensed under the Creative Commons
Attribution-NonCommercial-NoDerivs 2.0 License. To
view a copy of this license, visit
http://creativecommons.org/licenses/by-nc-nd/2.0/uk
########## Shell Commands ##########
Installation:
$ gem install capistrano
@kix
kix / style.css
Created October 2, 2012 07:55
Pillarbox CSS
#box {
padding: 30px 45px;
color: black;
background-color: white;
width: 960px;
line-height: 1.4;
-webkit-box-shadow: 0px 0 53px rgba(0, 0, 0, 1), 2px 0 5px rgba(0, 0, 0, 1);
}