Skip to content

Instantly share code, notes, and snippets.

@fumokmm
fumokmm / printlnswing.groovy
Created July 25, 2011 04:04
printlnswing.groovy
import groovy.swing.SwingBuilder
import javax.swing.JFrame
import java.awt.GridLayout
def printlnswing(message) {
new SwingBuilder().edt {
frame(title: 'Message', pack: true, visible: true,
layout: new GridLayout(0, 1),
defaultCloseOperation: JFrame.EXIT_ON_CLOSE) {
message.eachLine() {
@kimukou
kimukou / HighlighterDemo_Test.groovy
Created April 5, 2011 07:07
HighlighterDemo_Test.groovy
// HighlighterDemo Test
//
// refarence http://itpro.nikkeibp.co.jp/article/COLUMN/20110329/358840/?ST=develop&P=3
// http://griffon.codehaus.org/SwingxBuilder
//
@Grab(group='org.swinglabs', module='swingx', version='1.6.1')
@Grab(group='org.codehaus.griffon', module='swingxbuilder', version='0.1.7')
import java.awt.Color;
@osima
osima / generateHoneycombDiagram.groovy
Created November 23, 2010 04:30
codes to draw honeycombs
import java.awt.*
class Utils {
def getGoodRenderingHints() {
def hints = new RenderingHints(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON)
hints.put(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY)
@henrik
henrik / yahoo_exchange_rates_jsonp.html
Created December 28, 2009 22:48
JavaScript to get currency exchange rates from Yahoo Finance as JSONP. No XHR!
Get exchange rate as JSONP via YQL.
YQL Console: http://developer.yahoo.com/yql/console
Query (USD to SEK): select rate,name from csv where url='http://download.finance.yahoo.com/d/quotes?s=USDSEK%3DX&f=l1n' and columns='rate,name'
Example code:
<script type="text/javascript">