Skip to content

Instantly share code, notes, and snippets.

View nexik's full-sized avatar

Tomasz Ślązok nexik

View GitHub Profile
@nexik
nexik / 1. Symfony
Created March 13, 2012 12:25
Symfony helpful snippets
_
@nexik
nexik / SVN:commands
Created March 16, 2012 13:29
SVN:commands
# add all new files to svn repo
svn status | grep ? | xargs svn add
# add to remove from svn (in next commit) all localy deleted files
svn status | grep \! | sed 's/\!//' | xargs svn delete
# after manually resolving conflict
svn resolve PATH --accept working
# ssh checkout
@nexik
nexik / gist:3038632
Created July 3, 2012 09:01
Sublime Text 2 Config
{
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",
"detect_indentation": true,
"detect_slow_plugins": false,
"font_face": "consolas",
"font_size": 10,
"highlight_line": true,
"ignored_packages":
[
"Vintage",
<?php
// execute raw SQL
Doctrine_Manager::connection()->exec('SQL');
@nexik
nexik / Uniqueness.php
Created January 15, 2014 21:20
Phalcon\Validation\Validator\Db\Uniqueness
<?php
namespace Phalcon\Validation\Validator\Db;
use Phalcon\Validation\Validator;
use Phalcon\Validation\ValidatorInterface;
use Phalcon\Validation\Message;
use Phalcon\Db\Adapter\Pdo as DbConnection;
use Phalcon\Validation\Exception as ValidationException;
class Uniqueness extends Validator implements ValidatorInterface
<?php
namespace App;
use Nest\Application\Cli as Application;
class Cli extends Application
{
public function configure()
{
$this->add(new Task\I18n\SynchronizeCommand($this->di->get('config')));
@nexik
nexik / DevHelper.php
Created April 19, 2014 23:31
SpecBDD in Codeception
<?php
namespace Codeception\Module;
use Codeception\Module;
use Codeception\PHPUnit\AssertWrapper;
use Closure;
class DevHelper extends Module
{
private $testSubject;
@nexik
nexik / gist:0423f66405a596f99688
Last active August 29, 2015 14:10
jQuery WTF
$(function() {
var centerAbsolute = function () {
$('.absolute-center').css({
position:'absolute',
left: ($(window).width() - $('.absolute-center').outerWidth())/2,
top: ($(window).height() - $('.absolute-center').outerHeight())/2
});
}
centerAbsolute();
@nexik
nexik / EmailAddress.php
Created December 20, 2014 22:11
User and EmailAddress as ValueObject
<?php
namespace AppBundle\Entity\User
class EmailAddress
{
private $address;
public function __construct($address)
{
@nexik
nexik / User.EmailAddress.orm.yml
Created December 20, 2014 22:16
User EmailAddress Value Object Mappings Doctrine2
AppBundle\Entity\User\EmailAddress:
type: embeddable
fields:
address:
column: email
type: string
length: '250'