Skip to content

Instantly share code, notes, and snippets.

View tacman's full-sized avatar

Tac Tacelosky tacman

View GitHub Profile
@bjo3rnf
bjo3rnf / example_form.html.twig
Last active November 14, 2023 08:52
Stimulus.js controller for Symfony collection form type with configurable item limit
{% macro collection_item(form) %}
<div data-form-collection-target="field">
{{ form_widget(form) }}
<button type="button"
data-action="form-collection#removeItem">
remove
</button>
</div>
{% endmacro %}
@vielhuber
vielhuber / script.sh
Last active March 13, 2024 12:12
PostgreSQL: Backup and restore export import pg_dump with password on command line #sql
# best practice: linux
nano ~/.pgpass
*:5432:*:username:password
chmod 0600 ~/.pgpass
# best practice: windows
edit %APPDATA%\postgresql\pgpass.conf
*:5432:*:username:password
# linux
@grevory
grevory / bootstrap-photo-with-caption.html
Created April 12, 2013 04:47
Simple markup for adding captions and credits to images with Twitter Bootstrap.
<style>
.thumbnail.with-caption {
display: inline-block;
background: #f5f5f5;
}
.thumbnail.with-caption p {
margin: 0;
padding-top: 0.5em;
}
.thumbnail.with-caption small:before {
@nacmartin
nacmartin / builder.php
Created March 9, 2012 19:38
knpmenu + twitter bootstrap
<?php
class Builder extends ContainerAware
{
public function adminMenu(FactoryInterface $factory, array $options)
{
$menu = $factory->createItem('root');
$menu->setChildrenAttribute('class', 'nav'); //esto es el tema
$menu->setCurrentUri($this->container->get('request')->getRequestUri());
...