Skip to content

Instantly share code, notes, and snippets.

@regis-leray
regis-leray / gist:51682de444ff4027825d
Created February 17, 2015 15:36
Mock Bean Factory
import org.mockito.internal.util.MockUtil;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessorAdapter;
/**
* Do not process wiring for mock which contains @Autowired / @inject annotations
*/
public class MockBeanFactory extends InstantiationAwareBeanPostProcessorAdapter {
private static final MockUtil mockUtil = new MockUtil();
@regis-leray
regis-leray / gist:6a296f9511b54930725e
Last active August 29, 2015 14:11
wicket dynamic panel
public class TestWicket {
WicketTester tester = new WicketTester();
@BeforeMethod
public void setUp() throws Exception {
tester = new WicketTester();
}
@AfterMethod
@regis-leray
regis-leray / debian repository
Last active August 29, 2015 14:00
cron + create deb repository
crontab -l
@reboot inoticoming --logfile /var/www/depot/logs/inoticoming-snapshot.log /var/www/depot/snapshot/binary --stderr-to-log --stdout-to-log --suffix '.changes' /usr/local/bin/update-apt-upload.sh /var/www/depot/snapshot \;
@reboot inoticoming --logfile /var/www/depot/logs/inoticoming-release.log /var/www/depot/release/binary --stderr-to-log --stdout-to-log --suffix '.changes' /usr/local/bin/update-apt-upload.sh /var/www/depot/release \;
cat /usr/local/bin/update-apt-upload.sh
#!/bin/sh
REPO_DIR=$1
@regis-leray
regis-leray / Exclude maven profile
Created February 10, 2014 01:42
Exclude maven profile
mvn clean install '-P!CommercialDBJars,!MediumTests'
@regis-leray
regis-leray / Run maven surefire debug mode
Created February 10, 2014 01:40
Run maven surefire debug mode
mvn clean test -Dmaven.surefire.debug="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -Xnoagent -Djava.compiler=NONE"
@regis-leray
regis-leray / Release on steroid
Last active August 29, 2015 13:56
Release on steroid
### Pre step / Execute Shell
# Remove the snapshot from the project version
project_version=`xpath -q -e "/project/version/text()" pom.xml`
mvn versions:set -DnewVersion=${project_version%-SNAPSHOT}-build.${BUILD_NUMBER}
### Build
clean deploy -Pintegration,release -Denvironment=int -Dpackage-deb=true -Dinstall-deb=true
@regis-leray
regis-leray / import git repo into antoher with history
Last active August 29, 2015 13:56
Import git repository with history
git clone git@github.com:flyway/flyway.git
cd flyway
# move into another folder with rewriting the history
git filter-branch -f --prune-empty --tree-filter 'mkdir -p .root;mv * .root;mv .root root' -- --all
git clone git@github.com:regis-leray/flyway.git regis-flyway
cd regis-flyway/
git remote add origin-flyway ../flyway
git fetch origin-flyway
@regis-leray
regis-leray / jquery-links
Created July 18, 2013 12:12
Jquery links
@regis-leray
regis-leray / maven3-links
Last active December 19, 2015 22:39
Maven 3
@regis-leray
regis-leray / gist:6028773
Last active December 19, 2015 22:39
Css links
CSS/VERTICAL ALIGN
http://forum.alsacreations.com/topic.php?fid=4&tid=664&p=1
http://www.loriswebs.com/html-tips/verticallyalignimages.html
http://forum.alsacreations.com/topic.php?fid=4&tid=35#copy
http://openweb.eu.org/articles/initiation_flux/
CSS/FLOAT