This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class JavaScriptTest { | |
public static void main(String[] args) throws Exception { | |
ScriptEngineManager factory = new ScriptEngineManager(); | |
ScriptEngine engine = factory.getEngineByName("JavaScript"); | |
engine.eval("print('hello, world!')"); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AppleScriptTest { | |
public static void main(String[] args) throws Exception { | |
ScriptEngineManager factory = new ScriptEngineManager(); | |
ScriptEngine engine = factory.getEngineByName("AppleScript"); | |
engine.eval("tell application \"Finder\"\n display dialog \"Who cares?\"\n end tell"); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd ~/Work | |
# retrieve the latest version of git | |
git clone git://git.kernel.org/pub/scm/git/git.git | |
cd git/ | |
make GITWEB_PROJECTROOT="/Users/jmesnil/Work/" \ | |
GITWEB_CSS="/gitweb/gitweb.css" \ | |
GITWEB_LOGO="/gitweb/git-logo.png" \ | |
GITWEB_FAVICON="/gitweb/git-favicon.png" \ | |
bindir=/opt/local/bin | |
gitweb/gitweb.cgi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env jruby | |
require 'rubygems' | |
require 'jmx4r' | |
runtime = JMX::MBean.find_by_name "java.lang:type=Runtime" | |
# runtime.system_properties is a TabularData | |
runtime.system_properties.each do | sysprop | | |
puts "#{sysprop["key"]} = #{sysprop["value"]}" | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env jruby | |
require 'rubygems' | |
require 'jmx4r' | |
require 'jconsole' | |
mem_pools = JMX::MBean.find_all_by_name "java.lang:type=MemoryPool,*" | |
mem_pools.each do |pool| | |
# print the 'name' property of the pool's ObjectName | |
puts pool.object_name["name"] | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in {1..100} | |
do | |
echo $i | |
ant -Dtest-mask=JMSServerControl2Test integration-tests | |
if [ $? != 0 ] ; then | |
break | |
fi | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn verify-challenge | |
[callback mode topic challenge] | |
(let [url (build-callback-url callback mode topic challenge)] | |
(try | |
(= challenge (.trim (apply str (:body-seq (request url))))) 204 | |
(catch Exception ex (failed-challenge callback (.getMessage ex)))))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RESP_FILE=/tmp/gist.tmp | |
rm -f $RESP_FILE | |
USER=`git config --global github.user` | |
USERAVAIL=$? | |
TOKEN=`git config --global github.token` | |
TOKENAVAIL=$? | |
if [ $USERAVAIL -eq 0 -a $TOKENAVAIL -eq 0 ]; then | |
AUTH="--data-urlencode login=$USER --data-urlencode token=$TOKEN" | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn verify-subscriber [callback sync mode topic challenge] | |
(debug callback sync mode topic challenge) | |
(if sync | |
(verify-challenge callback mode topic challenge) | |
202)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* JBoss, Home of Professional Open Source | |
* Copyright 2005, JBoss Inc., and individual contributors as indicated | |
* by the @authors tag. See the copyright.txt in the distribution for a | |
* full listing of individual contributors. | |
* | |
* This is free software; you can redistribute it and/or modify it | |
* under the terms of the GNU Lesser General Public License as | |
* published by the Free Software Foundation; either version 2.1 of | |
* the License, or (at your option) any later version. |
OlderNewer