Skip to content

Instantly share code, notes, and snippets.

@justinedelson
justinedelson / gist:851333
Created March 2, 2011 17:36
httpclient -> exodus
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.httpclient.methods.PostMethod;
import org.apache.commons.httpclient.methods.StringRequestEntity;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
public class HttpPostBody {
private static Log log = LogFactory.getLog(HttpPostBody.class);
<div class="bq_mainnav">
<ul>
<li class="bq_showNav">
<a href="/shows.html">Shows</a>
<ul class="bq_mainnavList">
<li>
<ul>
<li class="bq_title">
<img alt="" src="/etc/designs/betcom/img/logo_bet_nav_dropdown_shows.png">
</li>
@justinedelson
justinedelson / gist:1119360
Created August 2, 2011 00:46
diff between env in terminal and iterm2
2c2
< TERM_PROGRAM=Apple_Terminal
---
> TERM_PROGRAM=iTerm.app
4c4
< TERM=xterm-256color
---
> TERM=xterm
9d8
< TERM_PROGRAM_VERSION=297
@justinedelson
justinedelson / gist:1359911
Created November 12, 2011 02:16
AdapterWebConsolePlugin POC
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with this
* work for additional information regarding copyright ownership. The ASF
* licenses this file to You under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@justinedelson
justinedelson / adapters.json
Created November 12, 2011 03:36
Adapter JSON file
[
{
"adaptables":"org.apache.sling.api.resource.Resource",
"adapters":[
"javax.jcr.Node",
"javax.jcr.Item",
"java.net.URL",
"java.util.Map",
"org.apache.sling.api.resource.ValueMap"
],
@justinedelson
justinedelson / gist:2871513
Created June 4, 2012 23:40 — forked from efroese/gist:2869165
remove sling from maven-launchpad-plugin output
<?xml version="1.0"?>
<!--
Licensed to the Sakai Foundation (SF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The SF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
@justinedelson
justinedelson / gist:2879365
Created June 6, 2012 01:48
replacement for servlet archetype pom
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
@justinedelson
justinedelson / gist:3942776
Created October 24, 2012 00:02
maven profiles for installing package in author and publish
<profiles>
<profile>
<id>autoInstallPackageAuthor</id>
<build>
<plugins>
<plugin>
<groupId>com.day.jcr.vault</groupId>
<artifactId>content-package-maven-plugin</artifactId>
<executions>
<execution>
@justinedelson
justinedelson / gist:3955062
Last active October 12, 2015 02:08
Install vlt (3.0.0) using Homebrew
First Time:
$ brew tap justinedelson/homebrew-filevault
$ brew install filevault
Every Other Time:
$ brew update
$ brew upgrade filevault
@justinedelson
justinedelson / quiesce.groovy
Created February 21, 2013 20:21
Groovy script to quiesce a CRX/CQ instance
import javax.management.remote.JMXServiceURL;
import javax.management.remote.JMXConnectorFactory;
import javax.management.ObjectName;
// assuming that CQ is started with -Dcom.sun.management.jmxremote.port=9000
def jmxUrl = "service:jmx:rmi:///jndi/rmi://localhost:9000/jmxrmi";
def serviceUrl = new JMXServiceURL(jmxUrl);
def jmxConnector = JMXConnectorFactory.connect(serviceUrl);
def mbeanConn = jmxConnector.getMBeanServerConnection();