Skip to content

Instantly share code, notes, and snippets.

@djeikyb
djeikyb / fixsort
Created January 28, 2012 08:13
Copy TPE1 to TSOP to prevent ipod displaying first last but sorting last first
#!/bin/bash
# Requires mutagen. I used 1.20
# http://code.google.com/p/mutagen/
#
# Changes artist sort tag from Last, First to just
# be whatever the artist name is.
"ls" *mp3 | while read FILE
do
TPE1=$(mid3v2 -l "$FILE" | "grep" TPE1 | cut -d= -f2)
@djeikyb
djeikyb / gist:5680749
Created May 30, 2013 20:08
playing with fibonacci sequence generators
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class Fibonacci
{
public static void main(String...args)
{
// fib(new BigInteger("7886"));
@djeikyb
djeikyb / gist:5682131
Last active December 17, 2015 22:29
registry skeleton. now with some flesh.
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Collection;
import java.util.Collections;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
@djeikyb
djeikyb / gist:5726560
Created June 7, 2013 01:50
playing with java/app/mysql types
package gps.absenceCalc2.registry;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import javax.naming.NamingException;
find . -iname "*.flac" | sed -e 's/\.flac//' | parallel ./flac2mp3.sh 4 {}.{flac,mp3}
@djeikyb
djeikyb / SortedSetList
Created September 20, 2013 22:23
Dumb wrapper to satisfy jsf 1.2 repeats, eg h:datatable
package gps.absenceCalc2.web.ui;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
import java.util.SortedSet;
import java.util.TreeSet;
@djeikyb
djeikyb / buildwar
Last active December 28, 2015 10:29
sample build.xml to build a war and deploy to tomcat
<?xml version="1.0"?>
<project name="ffn" default="main" basedir=".">
<!-- Properties-->
<property name="tomcat" location="/usr/share/tomcat7" />
<property name="app-name" value="ffn" />
<property name="war-name" value="ffn.war" />
<property name="src.dir" location="src" />
<property name="dist.dir" location="dist" />
<property name="build.dir" location="build/classes" />
@djeikyb
djeikyb / ForwardingSortedSet.java
Last active December 28, 2015 21:49
forwarding sorted set. cf effective java (joshua bloch)
/**
* Indiscriminately forwards the sorted set methods to the backing sorted set.
* <p>
* {@link #toString()} is also forwarded. equals and hashcode are not
* implemented.
*/
public abstract class ForwardingSortedSet<E> implements SortedSet<E>
{
protected SortedSet<E> set;
@djeikyb
djeikyb / ForwardingMap.java
Created November 20, 2013 17:14
forwarding map. cf effective java (joshua bloch)
/**
* Indiscriminately forwards the map methods to the backing map.
* <p>
* {@link #toString()} is also forwarded. equals and hashcode are not
* implemented.
*/
public abstract class ForwardingMap<K, V> implements Map<K, V>
{
protected Map<K, V> map;
@djeikyb
djeikyb / ForwardingList.java
Last active December 28, 2015 21:49
forwarding list. cf effective java (joshua bloch)
/**
* Indiscriminately forwards the list methods to the backing list.
* <p>
* {@link #toString()} is also forwarded. equals and hashcode are not
* implemented.
*/
public class ForwardingList<E> implements List<E>
{
protected List<E> list;