This file contains 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
import org.eclipse.swt.custom.StyledText | |
import org.eclipse.swt.custom.StyleRange | |
class KeyListener | |
def initialize(shell) | |
@shell = shell | |
end | |
def key_pressed(e) |
This file contains 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
package com.sporkmonger.rmud.swt.custom; | |
import java.util.ArrayList; | |
import java.util.regex.Matcher; | |
import java.util.regex.Pattern; | |
import org.eclipse.swt.SWT; | |
import org.eclipse.swt.custom.LineStyleEvent; | |
import org.eclipse.swt.custom.LineStyleListener; | |
import org.eclipse.swt.custom.StyleRange; |
This file contains 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
module Redcar | |
class REPL | |
class Tab < Redcar::EditTab | |
... | |
def update_cursor_size | |
if widget = edit_view.controller.mate_text.get_text_widget | |
caret = Swt::Widgets::Caret.new(widget, Swt::SWT::NONE) |
This file contains 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
require "java" | |
java_import javax.swing.JOptionPane | |
class Whazzup | |
def initialize(file = "#{ENV['HOME']}/snippets.txt") | |
@snippets ||= open(file, 'ab') | |
log('[Starting up (ruby)]') | |
thread_loop = Thread.current |
This file contains 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
/** | |
* jQuery.support.cssProperty | |
* To verify that a CSS property is supported (or any of its browser-specific implementations) | |
* | |
* @param string p - css property name | |
* [@param] bool rp - optional, if set to true, the css property name will be returned, instead of a boolean support indicator | |
* | |
* @Author: Axel Jack Fuchs (Cologne, Germany) | |
* @Date: 08-29-2010 18:43 | |
* |
This file contains 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
#export GRAILS_VERSION="$(ls -lhr $HOME/.grails | egrep -i '1\.' | head -1 | gawk '{print $9 }')" | |
export GRAILS_VERSION=`cat $GRAILS_HOME/build.properties | grep "^grails.version=" | awk -F= '{ print $2 }' | tr -d '\r' | tr -d '\n'` | |
_get_domain_classes(){ | |
find ./grails-app/domain -iname *.groovy 2> /dev/null | tr \\n ' ' | sed 's/\.groovy//g' | sed 's/\.\/grails-app\/domain\///g' | tr '/' \. | |
} | |
_get_tests(){ | |
find ./test -iname *.groovy 2> /dev/null | sed 's/\.\/test\/integration\///g' | sed 's/\Tests.groovy//g' | tr '/' \. | |
} |
This file contains 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
{ | |
"patterns" : [ | |
{ | |
"pattern" : "(.*)\\/my_project\\/grails-app\\/(services|controllers)\\/(.*)(Service|Controller)\\.groovy", | |
"1" : { | |
"link" : "$1 + '/my_project/grails-app/domain/' + $3 + '.groovy'", | |
"name" : "Model" | |
}, | |
"2" : { | |
"link" : "$1 + '/my_project/grails-app/views/' + (a = $3.split('/').last.split(//); a[0] = a[0].downcase; a.join) + '/CURRENT_WORD.gsp'", |
This file contains 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
// Documentation on Event hooks: http://grails.org/doc/latest/guide/4.%20The%20Command%20Line.html#4.3%20Hooking%20into%20Events | |
// Inspiration: http://www.anyware.co.uk/2005/2007/05/02/grails-script-notifications-via-growl/ | |
Ant = new AntBuilder() | |
eventStatusFinal = { msg -> | |
notifySend(msg) | |
} | |
void notifySend(String message) { |
This file contains 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
# Open in Redcar | |
# Run Plugins > Execute > Eval Current Tab (in Redcar itself) | |
# (This is a terrible hack) | |
require 'java' | |
def init | |
make_pretty | |
Redcar.app.add_listener(:window_added) do |win| | |
make_pretty |
This file contains 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
# Run via Redcar menu > Plugins > Execute > Eval Current Tab (within Redcar) | |
include Redcar | |
def get_swt_color hex_value | |
Swt::Graphics::Color.new( | |
ApplicationSWT.display, | |
hex_value[1,2].hex, | |
hex_value[3,2].hex, | |
hex_value[5,2].hex |