Skip to content

Instantly share code, notes, and snippets.

@lrusev
lrusev / _mixins.scss
Created May 22, 2014 10:10
sass table columng width generator
@mixin cols-width($sizes, $unit:"%") {
@if type-of($sizes) != list {
@if strip-unit($sizes) != $sizes {
$unit: unit($sizes);
}
&.width-#{strip-unit($sizes)} th:nth-child(1),
&.width-#{strip-unit($sizes)} td:nth-child(1) {
width: #{strip-unit($sizes)}#{$unit}
}
@lrusev
lrusev / phpunit.xml
Created June 10, 2014 07:28
tdd phpunit config
<phpunit bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticeToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false">
<testsuites>
@lrusev
lrusev / install.sh
Created January 16, 2015 11:37
Symfony2 Install project shell script
#shouldn't be used on production, just for dev
curl -sS https://getcomposer.org/installer | php
php composer.phar install
bin/console doctrine:database:create
bin/console doctrine:schema:update --force
bin/console doctrine:fixture:load -e=prod
bin/console assets:install public_html --symlink
bin/console fos:js-routing:dump --target=public_html/js/routes.js
bin/console assetic:dump public_html/
bin/console cache:clear -e=prod
@lrusev
lrusev / update.sh
Created January 16, 2015 11:39
Symfony2 update project shell script
#shouldn't be used on production, just for dev
svn up composer.json
php composer.phar update
svn up
bin/console doctrine:schema:update --force
bin/console doctrine:fixture:load -e=prod
bin/console assets:install public_html --symlink
rm -rf var/cache/* public_html/assetic
bin/console fos:js-routing:dump --target=public_html/js/routes.js
bin/console assetic:dump public_html/
Ext.define('DRSI.datasets.AddDocumentsForm', {
extend: 'Ext.window.Window',
title: 'Add Documents',
modal: true,
closable: false,
width: 400,
items: [{
id: 'DocumentDropZone',
xtype: 'container',
//you may have some more configs here...
providers:
user:
entity: { class: MyAppBundle:User, property: loginEmail }
admin:
entity: { class: MyAppBundle:Admin, property: username }
firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
@lrusev
lrusev / fiddle
Last active August 29, 2015 14:20
yeoman playground scaffolding
#!/bin/bash
EXMSG="Detected that project already exists, please use another one."
PROJEXMSH="Detected that project already exists"
GENERATOR="playground"
if ! which nodejs >/dev/null; then
echo "Install nodejs"
sudo apt-get update
sudo apt-get install nodejs
fi
@lrusev
lrusev / RoboFile.php
Last active February 2, 2016 13:49
Codeception robo file
<?php
/**
* This is project's console commands configuration for Robo task runner.
*
* @see http://robo.li/
*/
class RoboFile extends \Robo\Tasks
{
const TITLE_PASSED = 'Test Passed';
@lrusev
lrusev / composer.json
Last active January 28, 2016 11:05
Global composer dependencies
{
"require": {
"phpunit/phpunit": "^4.6",
"halleck45/phpmetrics": "^1.7",
"hirak/prestissimo": "^0.1.4",
"sebastian/phpcpd": "*",
"sebastian/phpdcd": "*",
"phpmd/phpmd": "*",
"squizlabs/php_codesniffer": "*"
}
@lrusev
lrusev / serve
Created February 2, 2016 09:19
Local server alias
alias serve="xdg-open ~/Documents/refresh.html 2>&1 > /dev/null; python -m SimpleHTTPServer 8889"
------------------------------refresh.html-------------------------
<html>
<head>
<meta http-equiv="refresh" content="1;url=http://localhost:8889/" />
</head>
<body>
Redirect to <a href="http://localhost:8889">http://localhost:8889</a>
</body>