Skip to content

Instantly share code, notes, and snippets.

View olivsinz's full-sized avatar
🎯
Focusing

OLIVIER Z. olivsinz

🎯
Focusing
View GitHub Profile
@benck
benck / x-editable-bs4.js
Last active January 21, 2021 08:44
A fix for x-editable to be compatible with bootstrap 4.0.0 alpha 5 and jQuery 3.1.1. Make sure you include Tether for bootstrap 4. (The button is changed to Fontawesome, you may change the $.fn.editableform.buttons to your desired buttons.)
/*! X-editable - v1.5.1
* In-place editing with Twitter Bootstrap, jQuery UI or pure jQuery
* http://github.com/vitalets/x-editable
* Copyright (c) 2013 Vitaliy Potapov; Licensed MIT */
/**
Form with single input element, two buttons and two states: normal/loading.
Applied as jQuery method to DIV tag (not to form tag!). This is because form can be in loading state when spinner shown.
Editableform is linked with one of input types, e.g. 'text', 'select' etc.
@class editableform
@fullpipe
fullpipe / sonata_admin_child_admin.md
Last active November 8, 2018 13:55
sonata admin child admin

from smlr

First, create your AAdmin, ABAdmin and BAdmin Classes like you would, if those Classes wouldn't share any relation. After this, add to your sonata.admin.A service a Child sonata.admin.AB (Admin.yml or Admin.xml).

Than you can use the configureSideMenu() method in AAdmin to create a sidemenu and generate a link to ABAdmin.

It's important to add $parentAssociationMapping to your ABAdmin Class and adding some if-statements to improve the usability, if list and form is in a A-context.

If you know the mechanism, it's quite easy. Hope my example works for you..

@carolineschnapp
carolineschnapp / Add Color Swatches using hex values.md
Last active August 5, 2024 10:32
Add Color swatches to #Brooklyn theme. Use hexadecimal values or images.

What we want

We want to go from this:

Alt text

... to that:

Alt text

@webdevilopers
webdevilopers / ContractController.php
Last active March 11, 2020 09:00
Symfony Event Listener to send html mail using SwiftMailer and Twig
<?php
namespace Acme\Bundle\ContractBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class ContractController extends Controller
{
public function eventAction(Contract $contract)
{
$event = new ContractEvent($contract);
@vladimirtsyupko
vladimirtsyupko / gist:10964772
Created April 17, 2014 08:32
Git force pull to overwrite local files
git fetch --all
git reset --hard origin/master
git pull origin master