This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ac.simons.utils; | |
import java.util.Comparator; | |
/** | |
* @author michael.simons, 2011-02-15 | |
*/ | |
public class ExtendedAntPathMatcher implements PathMatcher { | |
private final AntPathMatcher delegate = new AntPathMatcher(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<bean id="validator" class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean" /> | |
<bean id="conversion-service" class="org.springframework.format.support.FormattingConversionServiceFactoryBean" /> | |
<bean id="pathMatcher" class="ac.simons.utils.ExtendedAntPathMatcher" /> | |
<bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping"> | |
<property name="order" value="0" /> | |
<property name="useDefaultSuffixPattern" value="true" /> | |
<property name="pathMatcher" ref="pathMatcher" /> | |
</bean> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Enable dailyfratze.de oEmbed | |
Description: Enables automatic embedding of pictures from dailyfratze.de through oEmbed | |
Author: Michael Simons | |
Version: 1.0 | |
Author URI: http://michael-simons.eu | |
*/ | |
// Profile | |
wp_oembed_add_provider('#https?://dailyfratze\.(?:de|com)/([a-z]+\w*)#i', 'https://dailyfratze.de/app/oembed.json', true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Enable Twitter oEmbed | |
Description: Enables automatic embedding of twitter updates through oembed | |
Author: Michael Simons | |
Version: 1.0 | |
Author URI: http://michael-simons.eu | |
*/ | |
wp_oembed_add_provider('#https?://twitter.com/\#!/[a-z0-9_]{1,20}/status/\d+#i', 'https://api.twitter.com/1/statuses/oembed.json', true); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysqldump -uroot -pblah --opt --routines --add-drop-database --default-character-set=utf8 --create-options --databases db1 db2 usw | bzip2 > backup.sql.bz2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* FancyBox - jQuery Plugin | |
* Simple and fancy lightbox alternative | |
* | |
* Examples and documentation at: http://fancybox.net | |
* | |
* Copyright (c) 2008 - 2010 Janis Skarnelis | |
* That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated. | |
* | |
* Version: 1.3.4 (11/11/2010) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class UTF8 { | |
public static void main(String[] args) { | |
// See http://www.fileformat.info/info/unicode/char/1f4a9/index.htm | |
final String poo = "A pile of poo: 💩."; | |
System.out.println(poo); | |
// Length of chars doesn't equals the "real" length, that is: the number of actual codepoints | |
System.out.println(poo.length() + " vs " + poo.codePointCount(0, poo.length())); | |
// Iterating over all chars |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: UTF-8 | |
require 'rubygems' | |
require 'date' | |
require 'optparse' | |
require 'ostruct' | |
require 'oauth' | |
require 'json' | |
class FitbitArchiver |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd ~/the/old/repo | |
find -E . -regex ".*(File1|File2)\.java" | xargs git log --pretty=email --patch-with-stat --reverse | (cd ~/the/new/repo && git am) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ac.simons.utils; | |
/** | |
* Use it like throw Unchecker.uncheck(checkedException); | |
* | |
* @author Michael J. Simons, 2012-02-03 | |
* http://www.gamlor.info/wordpress/2010/02/throwing-checked-excpetions-like-unchecked-exceptions-in-java/ | |
*/ | |
public final class Unchecker { | |
private Unchecker(){} |
OlderNewer