Skip to content

Instantly share code, notes, and snippets.

View devpg's full-sized avatar

André Neubauer devpg

View GitHub Profile
#!/bin/bash
echo Searching in $1
echo ... based on $2
echo ... and copying to $3
mkdir -p $3
SUFFIX="_a.jpg"
@devpg
devpg / Eclipse-codeFormatter.xml
Created April 27, 2013 15:54
Minimal adjusted Eclipse code formatter
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<profiles version="12">
<profile kind="CodeFormatterProfile" name="devpg" version="12">
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="@formatter:off"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/>
@devpg
devpg / exportITunesMusicLibraryByGenre
Created December 22, 2012 20:18
Exports the iTunes music library of the current user by coping *.mp3 files into folder based on the genre
#!/bin/bash
# Rewrite IFS default seperator
SAVEIFS=$IFS
IFS=$(echo -en "\n\b")
itunesFolder="/Users/$USER/Music/iTunes/iTunes Media/Music"
for file in $(find "$itunesFolder" -name '*.mp3'); do
genre=$(id3v2 -l "$file" | sed -n '/^TCON/s/^.*: //p' | sed 's/ (.*//')
@devpg
devpg / id3v2-genre
Created July 22, 2012 10:46
Returns the genre of a mp3 file (based on its id3v2 tag)
#!/bin/bash
genre=$(id3v2 -l "$1" | sed -n '/^TCON/s/^.*: //p' | sed 's/ (.*//')
echo $genre