Skip to content

Instantly share code, notes, and snippets.

View gjoseph's full-sized avatar

Grégory Joseph gjoseph

  • Sydney, Australia
View GitHub Profile
→ 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
#!/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
@gjoseph
gjoseph / content
Created September 8, 2014 14:25
git-all
#!/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 ""
Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): 439: 1120
Define value for property 'groupId': : com.lol
Define value for property 'artifactId': : loltheme
Define value for property 'version': 1.0-SNAPSHOT: :
Define value for property 'package': com.lol: :
Define value for property 'magnolia-stk-version': : 1.2.3
Define value for property 'magnolia-version': : 4.5.6
Define value for property 'theme-name': : my-lol-theme
Confirm properties configuration:
groupId: com.lol
# cat gitolite-suexec-wrapper.sh
#!/bin/dash
# http://groups.google.com/group/gitolite/browse_thread/thread/071c4a71e5509c0d/5bce97e503466199?pli=1
# http://sitaramc.github.com/gitolite/http.html
#g3: exec ${GITOLITE_HTTP_HOME}/gitolite-source/src/gitolite-shell
if [ -z "${HTTP_GITOLITE_HTTP_RC+xxx}" ]; then
echo HTTP_GITOLITE_HTTP_RC is not set 1>&2
exit 1
fi
diff --git a/magnolia-configuration/src/main/java/info/magnolia/config/registry/Registry.java b/magnolia-configuration/src/main/java/info/magnolia/config/registry/Registry.java
index 99b54eb..cff3bcf 100644
--- a/magnolia-configuration/src/main/java/info/magnolia/config/registry/Registry.java
+++ b/magnolia-configuration/src/main/java/info/magnolia/config/registry/Registry.java
@@ -60,6 +60,7 @@ public interface Registry<T> {
* TODO: do we need this method ? Is it usable ? Isn't query() more useful ?
* TODO: if we need it, can it throw a NoSuchDefinitionException? (if you have a metadata instance, it's an IllegalState if it doesn't point to a provider anymore)
# This should be a DummyThing
name: myDummyWithListAndMap
title: 'Some title'
enabled: true
level: 4
modelClass: info.magnolia.config.dummy.DummyModel
someBeans:
- a: first
b: second
- a: third
WILL EXECUTE git push --all --dry-run
./enterprise/advanced-cache:
To git@git.magnolia-cms.com:enterprise/advanced-cache
fc97d7e..8a9f0bf magnolia-module-advanced-cache-1.3.x -> magnolia-module-advanced-cache-1.3.x
8bd8545..1a90aea master -> master
./enterprise/backup:
To git@git.magnolia-cms.com:enterprise/backup
6f94c38..3ac993e magnolia-module-backup-1.0.x -> magnolia-module-backup-1.0.x
5718974..fc4218c magnolia-module-backup-1.1.x -> magnolia-module-backup-1.1.x
@gjoseph
gjoseph / sourcedrop
Last active August 29, 2015 14:20
Use SourceDrop from the command line
#!/bin/sh
# Set SourceDrop's keyboard shortcut to control-option-command-f13 (or whatever, really)
# F13 is code 105 (http://macbiblioblog.blogspot.ch/2014/12/key-codes-for-function-and-special-keys.html)
# Print out stuff and pipe it into this script (e.g cat ~/bin/sourcedrop | sourcedrop)
pbcopy && osascript -e 'tell application "System Events" to key code 105 using {control down, option down, command down}'
@gjoseph
gjoseph / SplitUtil.java
Created August 17, 2011 11:05
Why are there so many ways of getting a String[] from a comma-separated String in Java, and none of the basic ones really work (split(",") or StringTokenizer) ? I don't know, but this is my ultimate solution at the moment. Are there more cases to cover ?
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;
}