Skip to content

Instantly share code, notes, and snippets.

@naaman
naaman / gist:1053217
Created Jun 29, 2011
Hot Swapping With Maven, Jetty and IntelliJ
View gist:1053217

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 Mar 5, 2021
[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
View delete-heroku-apps.sh
for app in $(heroku apps); do heroku apps:destroy --app $app --confirm $app; done
@naaman
naaman / .gitignore
Created Dec 20, 2011
UTF-8 Character in Play View
View .gitignore
logs
project/project
project/target
target
tmp
@naaman
naaman / User.java
Created Feb 21, 2012
UserInfo call
View User.java
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
Open iTerm2 Pane and Execute a Command
View tab.sh
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
View vim-on-heroku.sh
#!/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
View updated-jdk-support.md

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

View multi-jdk-live.md
~/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.
View SecurityListings.java
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 Feb 20, 2013
jdk dyno scratch
View gist:4993390
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