Skip to content

Instantly share code, notes, and snippets.

@naaman
naaman / gist:1053217
Created June 29, 2011 05:33
Hot Swapping With Maven, Jetty and IntelliJ

Hot Swapping With Maven, Jetty and IntelliJ

Based on Configuring Jetty, Maven, and Eclipse together with Hot Swap

I've always been a bit jealous when it comes to the Play! framework and the great dev mode they have for hot swapping classes at runtime. Jetty has a configuration setting, scanIntervalSeconds, that mimics this when working with a more traditional WAR, but does so by looking for changes to a file and restarting the server.

Fortunately, Jetty also provides the ability to rapidly test code with hot swapping. No more server restarts. The trick to getting hot swapping to work is to attach a remote debugger to your Jetty process. The following instructions outline how to do this in IntelliJ (tested with IDEA 10.5 CE).

Modify your jetty-maven-plugin to ignore the scan interval

  1. Open your pom and locate the plugins section
@naaman
naaman / delete-heroku-apps.sh
Last active March 5, 2021 20:57
[WARNING THIS WILL HARD DELETE YOUR APPS. YOU COULD LOSE DATA. MAKE SURE YOU KNOW WHAT YOURE DOING!!!!!!!!!!] Delete all heroku apps from bash terminal -- no script file required
for app in $(heroku apps); do heroku apps:destroy --app $app --confirm $app; done
@naaman
naaman / .gitignore
Created December 20, 2011 19:31
UTF-8 Character in Play View
logs
project/project
project/target
target
tmp
@naaman
naaman / User.java
Created February 21, 2012 23:14
UserInfo call
package models;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import javax.xml.bind.annotation.XmlRootElement;
import java.io.Serializable;
/**
* TODO: Javadoc
*
@naaman
naaman / tab.sh
Created May 11, 2012 22:52
Open iTerm2 Pane and Execute a Command
pane() {
local currentDir=$(pwd)
osascript <<EOD
tell application "iTerm"
tell application "System Events" to keystroke "d" using command down
tell current session of current terminal
write text "cd $currentDir"
write text "$@"
end tell
end tell
@naaman
naaman / vim-on-heroku.sh
Last active July 6, 2023 13:50
vim on heroku
#!/usr/bin/env bash
mkdir vim
curl https://s3.amazonaws.com/heroku-vim/vim-7.3.tar.gz --location --silent | tar xz -C vim
export PATH=$PATH:/app/vim/bin
@naaman
naaman / updated-jdk-support.md
Created June 19, 2012 22:33
Updated JDK Support

Updated JDK Support

Heroku now offers beta support for OpenJDK 7, as well as an updated version of OpenJDK 6. Support for both JDKs are available in a new buildpack. OpenJDK 6 is still the default, but the version has been increased to u25 from u20 -- changes for u20-u25 can be found on Oracle's changelist blog. OpenJDK 7 can be enabled by configuring your pom.xml. Currently, only maven builds are supported with this update.

This update has no impact on any running applications. If you choose not to use this buildpack, your applications will continue to use OpenJDK 6u20.

Contents

@naaman
naaman / multi-jdk-live.md
Created September 6, 2012 18:11
Multi JDK Live
~/dev/bb[master] ★ heroku create
Creating shrouded-wave-4655... done, stack is cedar
http://shrouded-wave-4655.herokuapp.com/ | git@heroku.com:shrouded-wave-4655.git
Git remote heroku added
~/dev/bb[master] ★ git push heroku master 
Counting objects: 25, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (18/18), done.
Writing objects: 100% (25/25), 2.83 KiB, done.
@naaman
naaman / SecurityListings.java
Created September 12, 2012 22:26
List JCE Algorithms
import java.security.Provider;
import java.security.Security;
public class SecurityListings {
public static void main(String[] args) {
for (Provider provider : Security.getProviders()) {
System.out.println("Provider: " + provider.getName());
for (Provider.Service service : provider.getServices()) {
System.out.println(" Algorithm: " + service.getAlgorithm());
}
@naaman
naaman / gist:4993390
Created February 20, 2013 06:22
jdk dyno scratch
1 ls -lah
2 curl -O http://icedtea.wildebeest.org/download/source/icedtea-2.1.5.tar.gz
3 tar xvzf icedtea-2.1.5.tar.gz
4 cd icedtea-2.1.5
5 ./configure --with-parallel-jobs=2 --disable-docs --disable-bootstrap --with-jdk-home=/usr/lib/jvm/java-6-openjdk
6 cd ..
7 curl -O http://mirror.olnevhost.net/pub/apache//ant/binaries/apache-ant-1.8.4-bin.tar.gz
8 tar xf apache-ant-1.8.4-bin.tar.gz
9 ls -lah
10 ls -lah apache-ant-1.8.4