Skip to content

Instantly share code, notes, and snippets.

@carlosayam
carlosayam / gist:5316969
Last active January 4, 2022 03:30
Output branches description in Git (bash version)
#!/bin/bash
set -f
git branch | while read line; do
current=' '
name=${line##\* } ## removes leading * for current
if [ ! "$name" = "$line" ]; then current='* '; fi
description=`git config branch.$name.description`
echo "$current" $name : $description
done
@garyhodgson
garyhodgson / reprap-wiki-analysis.groovy
Created May 17, 2011 23:07
Parses a mediawiki export and generates an analysis of content for RepRap Wiki
#!/usr/bin/env groovy
import groovy.time.*
// Export File from http://reprap.org/wiki/Special:Export, using category: "Development"
def f2= new File('RepRapWiki-DevelopmentPages_LatestRevisions.xml')
def records = new XmlSlurper().parseText(f2.getText())
def pages = records.page