Skip to content

Instantly share code, notes, and snippets.

View rihards's full-sized avatar

Rihards Steinbergs rihards

View GitHub Profile
@bis-upr
bis-upr / git_housekeeping.sh
Last active September 1, 2017 09:05
Git cleanup merged branches with some time limits
#!/bin/bash
# The folowing code example will delete all merged branches to master(can be any) if the branch have no commits since 2 months.
echo "I am about to delete all git branches merged to master and haven't received any commits since 2 months."
echo "Are you sure about this? (y / n) >"
read answer
# Ops: Get all remote merged branches to master. Any filter to just list the required branchs 'Eg: grep ticket_111', so that we don't delete any major branches.
# remove 'origin/' from the remote branch name. Check if no commits since 2 months and if commit counts 0 the delete the remote branch
if [ $answer == "y" ]
@lolautruche
lolautruche / ezxml_to_html5.html.twig
Created October 15, 2013 18:29
Convert XmlText to HTML - eZ Publish 5
{% set html = content.getFieldValue( "my_xmltext_field" ).xml|xmltext_to_html5 %}
<div>
{{ html }}
</div>