Skip to content

Instantly share code, notes, and snippets.

View keyrepeat.shell
# Mac OS X Lion introduced a new, iOS-like context menu when you press and hold a key
# that enables you to choose a character from a menu of options. If you are on Lion
# try it by pressing and holding down 'e' in any app that uses the default NSTextField
# for input.
#
# It's a nice feature and continues the blending of Mac OS X and iOS features. However,
# it's a nightmare to deal with in Sublime Text if you're running Vintage (Vim) mode,
# as it means you cannot press and hold h/j/k/l to move through your file. You have
# to repeatedly press the keys to navigate.
@chmielot
chmielot / regexcrop.regex
Created Oct 11, 2012
Crop text after 20 chars with regex
View regexcrop.regex
([^\s][\s\S]{0,20}(?!=[^\s]))([\s]|$)
@chmielot
chmielot / gist:1992240
Created Mar 7, 2012
js: document ready
View gist:1992240
$(document).ready(function() {
});
@chmielot
chmielot / Stack_trace_multiple_choice.txt
Created Feb 24, 2012
Stack trace of empty multiple entity choice
View Stack_trace_multiple_choice.txt
Stack Trace
in /home/chmielot/public_html/nordwind/vendor/symfony/src/Symfony/Component/HttpKernel/Debug/ErrorHandler.php at line 65
}
if (error_reporting() & $level && $this->level & $level) {
throw new \ErrorException(sprintf('%s: %s in %s line %d', isset($this->levels[$level]) ? $this->levels[$level] : $level, $message, $file, $line));
}
return false;
at ErrorHandler ->handle ('2', 'array_fill(): Number of elements must be positive', '/home/chmielot/public_html/nordwind/vendor/doctrine-dbal/lib/Doctrine/DBAL/SQLParserUtils.php', '127', array('query' => 'SELECT j0_.id AS id0, ... FROM job j0_ WHERE j0_.id IN (?)', 'params' => array(), 'types' => array('102'), 'isPositional' => true, 'arrayPositions' => array(false), 'bindIndex' => '0', 'name' => '0', 'type' => '102', 'paramPos' => array('928'), 'paramOffset' => '0', 'queryOffset' => '0', 'needle' => '0', 'needlePos' => '928', 'len' => '0'))
at array_fill ('0', '0', '2')
View debian_symfony2_security.txt
# add your user to www-data and vise versa
sudo usermod -a -G www-data myusername
sudo usermod -a -G myusername www-data
# override umask in ~/.bashrc and /etc/init.d/apache2
umask 002
#restart
@chmielot
chmielot / twig template again
Created Jun 15, 2011
Generated Markup for subform
View twig template again
{% extends "BUMToolboxBundle::layout.html.twig" %}
{% form_theme form _self %}
{# ============== Customizations to rendering ===================== #}
{% block field_label %}
{% spaceless %}
<label for="{{ id }}"{% for attrname,attrvalue in attr %} {{attrname}}="{{attrvalue}}"{% endfor %}>{{ label|trans }}
{#
{% if required %}
View edit.html.twig
{% extends "BUMToolboxBundle::layout.html.twig" %}
{% form_theme form _self %}
{# ============== Customizations to rendering ===================== #}
{% block field_label %}
{% spaceless %}
<label for="{{ id }}"{% for attrname,attrvalue in attr %} {{attrname}}="{{attrvalue}}"{% endfor %}>{{ label|trans }}
{#
{% if required %}
@chmielot
chmielot / rendered form
Created Jun 14, 2011
Form prototype - rendered form
View rendered form
The loop renders:
<div id="participants">
<div id="manifest_participants_0">...</div>
<div id="manifest_participants_1">...</div>
</div>
(without prototype)
`form_widget(form.participants)` renders to:
<div id="participants">
<div id="manifest_participants">
View edit.html.twig
{% extends "BUMToolboxBundle::layout.html.twig" %}
{# ============== Template ===================== #}
{% block app_header %}
Manifest-Editor
{% endblock %}
{% block content %}
<form class="manifest-form" method="post" action="{{ app.request.requestUri }}">
@chmielot
chmielot / Controller_DefaultController.php
Created May 25, 2011
[Form] Boolean choice field not preselected
View Controller_DefaultController.php
<?php
namespace BUM\TestBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use BUM\TestBundle\Form\FooType;