Skip to content

Instantly share code, notes, and snippets.

View havvg's full-sized avatar

Toni Uebernickel havvg

View GitHub Profile
@havvg
havvg / DashboardPass.php
Created July 12, 2012 15:55
Example tagged map services
<?php
namespace Havvg\Bundle\DashboardBundle\DependencyInjection\Compiler;
use Havvg\Bundle\DRYBundle\DependencyInjection\Compiler\AbstractTaggedMapCompilerPass;
class DashboardPass extends AbstractTaggedMapCompilerPass
{
protected $mapServiceTag = 'havvg_dashboard.boardlet';
protected $targetServiceTag = 'havvg_dashboard.dashboard';
@havvg
havvg / config_dev.yml
Created July 24, 2012 09:52
optionally import Symfony2 configuration
imports:
- { resource: parameters_dev.yml }
- { resource: config.yml }
- { resource: config_local.yml, ignore_errors: true }
framework:
profiler:
only_exceptions: false
web_profiler:
@havvg
havvg / datepicker.js
Created July 24, 2012 12:55
jQuery datepicker fallback on HTML5 date incompatible browsers
jQuery(function($) {
var $inputs = $('input[type="date"]');
if (!$inputs.length) return;
/*
* The browser does not support the HTML5 date type.
*
* We add the datepicker as a fallback.
*/
@havvg
havvg / services.yml
Created July 26, 2012 15:31
alter default FormFlow storage using parent service attribute
services:
ormigo.form.flow:
class: Craue\FormFlowBundle\Form\FormFlow
parent: craue.form.flow
scope: request
calls:
# see https://gist.github.com/3066310
- [ setStorage, [ @ormigo.form.flow.storage.mongodb ] ]
ormigo.form.image_upload.flow:
@havvg
havvg / ajax-form.js
Created August 1, 2012 13:20
jQuery AJAX form submit with Twitter Bootstrap modal
jQuery(function($) {
$('form[data-async]').live('submit', function(event) {
var $form = $(this);
var $target = $($form.attr('data-target'));
$.ajax({
type: $form.attr('method'),
url: $form.attr('action'),
data: $form.serialize(),
@havvg
havvg / .gitconfig
Created August 7, 2012 10:30
Push to cloudControl with submodules
[alias]
   cctrl = push --recurse-submodules=check cloudcontrol
@havvg
havvg / PdoDumper.php
Created August 10, 2012 16:41
PdoLoader as translation resource for Symfony2
<?php
namespace Ormigo\Bundle\TranslationBundle\Translation\Dumper;
use Ormigo\Bundle\TranslationBundle\Translation\Loader\PdoLoader;
use Symfony\Component\Translation\Dumper\DumperInterface;
use Symfony\Component\Translation\MessageCatalogue;
class PdoDumper extends PdoLoader implements DumperInterface
@havvg
havvg / schema.xml
Created August 13, 2012 14:35
Propel 1.6: Sluggable with I18n
<?xml version="1.0" encoding="UTF-8"?>
<database name="default" defaultIdMethod="native" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://xsd.propelorm.org/1.6/database.xsd">
<table name="country">
<column name="id" type="integer" autoIncrement="true" primaryKey="true" />
<column name="iso_code" type="char" size="2" required="true" />
<column name="name" type="varchar" size="255" required="true" primaryString="true" />
<behavior name="i18n">
<parameter name="i18n_columns" value="name, url" />
<parameter name="default_locale" value="de_DE" />
@havvg
havvg / base.js
Created September 7, 2012 19:46
BackboneJS with your base model
(function(Sternenbund, $, undefined) {
Sternenbund.Model = Backbone.Model.extend({
url: function() {
return this.urlRoot+'/'+this.id+'.json';
}
});
// ..
Sternenbund.Venad = Sternenbund.Model.extend({
@havvg
havvg / monolog.yml
Last active October 10, 2015 21:58
Monolog handler configuration
monolog:
handlers:
log_everything:
type: fingers_crossed
action_level: critical
handler: grouped
channels: [!frontend, !deprecation]
grouped:
type: group