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
import java.util.regex.Pattern; | |
public class SplitUtil { | |
private static final Pattern COMMA_DELIMITED_SPLIT = Pattern.compile("(\\s*,\\s*)+"); | |
private static final String[] EMPTY = new String[0]; | |
public static String[] commaDelimited(String s) { | |
if (s == null) { | |
return EMPTY; | |
} |
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
/** | |
* So java.net.URLEncoder#encode(java.lang.String) is deprecated, because it uses the OS' default encoding, | |
* java.net.URLEncoder#encode(java.lang.String, java.lang.String) takes a second parameter for said encoding, | |
* while mentioning that "The World Wide Web Consortium Recommendation states that UTF-8 should be used. | |
* Not doing so may introduce incompatibilites.". (typo not mine). | |
* Still, we have to choose, read doc, and specify the ourselves, and deal with the uncanny possibility that | |
* UTF-8 might not be available on a system where we do have a 1.6 JVM. | |
* Right. | |
*/ |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE Repository PUBLIC "-//The Apache Software Foundation//DTD Jackrabbit 1.6//EN" "http://jackrabbit.apache.org/dtd/repository-1.6.dtd"> | |
<Repository> | |
<FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem"> | |
<param name="path" value="${rep.home}/repository" /> | |
</FileSystem> | |
<Security appName="Jackrabbit"> | |
<AccessManager class="org.apache.jackrabbit.core.security.simple.SimpleAccessManager"></AccessManager> | |
<LoginModule class="org.apache.jackrabbit.core.security.simple.SimpleLoginModule"> | |
<param name="anonymousId" value="anonymous" /> |
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
<!-- if this was declared in the <Host> configuration, we'd add a path="" attribute --> | |
<Context path="" docBase="/opt/acme-project/wars/acme-project-webapp-1.0-SNAPSHOT.war" debug="0" reloadable="false"> | |
<Parameter name="magnoliaInstance" value="prodPublic" override="false"/> | |
<Resource name="jdbc/MagnoliaAcmeDS" auth="Container" | |
type="com.mysql.jdbc.jdbc2.optional.MysqlDataSource" | |
factory="com.mysql.jdbc.jdbc2.optional.MysqlDataSourceFactory" | |
driverClassName="com.mysql.jdbc.Driver" | |
user="acme_magnolia" username="acme_magnolia" | |
password="secret" |
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
#!/usr/bin/env groovy | |
import groovy.transform.Canonical | |
def weird = new CanonicalIsWeird(a: 'first letter', b: 'second letter') | |
println "a: ${weird.a}" | |
println "b: ${weird.b}" | |
assert weird.a == 'first letter' | |
assert weird.b == 'second letter' |
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
# Exclude bots for requests with a query string, with the exception of the view=log query: bots can see the file's latest revision (no query string), or the log. | |
RewriteCond %{HTTP_USER_AGENT} bot [nocase] | |
RewriteCond %{QUERY_STRING} !(^view=log$|view=log&log_pagestart=[0-9]+$|^$) | |
RewriteRule /view/.* - [F,L] |
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
→ git show 82268d8 --name-status | |
commit 82268d869172883b45124d20bc7588bd3d096e2d | |
Author: Grégory Joseph <gregory.joseph@magnolia-cms.com> | |
Date: Mon Aug 18 14:22:47 2014 +0200 | |
QA: Removed unnecessary Object[] creation for methods that take a vararg - mostly log and Method.invoke() | |
M magnolia-core/src/main/java/info/magnolia/cms/core/MagnoliaAccessManager.java | |
M magnolia-core/src/main/java/info/magnolia/cms/core/search/QueryResultImpl.java | |
M magnolia-core/src/main/java/info/magnolia/cms/core/version/CopyUtil.java |
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
#!/bin/bash | |
pattern=$1 | |
if [ -z $pattern ]; then | |
echo "Please pass a pattern ! (e.g 'modules')" | |
exit -3 | |
fi | |
output=`ssh git@git.magnolia-cms.com expand $pattern` | |
echo "$output" | grep '^only' > /dev/null |
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
#!/bin/sh | |
CMD=$@ | |
echo WILL EXECUTE git $CMD | |
find . -name .git -exec dirname {} \; | while read dir; do | |
C=`pwd` | |
cd $dir | |
#echo "\033[1m`pwd`:\033[0m" | |
echo "\033[1m$dir:\033[0m" | |
git $CMD | |
echo "" |
OlderNewer