This pre-commit hook is checks the files being committed to fits two rules:
- No syntax error (both for Ruby and YAML files)
- If this is an TestUnit, Cucumber, or RSpec test, it should pass
| amend-commit = "!f() { START=`(git symbolic-ref -q HEAD || git rev-parse HEAD) | cut -d"/" -f 3`; git checkout -q $1 && git commit --amend && git rebase --onto HEAD $1 $START; }; f" |
| import javafx.animation.FadeTransition; | |
| import javafx.application.Application; | |
| import javafx.beans.property.ReadOnlyObjectProperty; | |
| import javafx.beans.value.ChangeListener; | |
| import javafx.beans.value.ObservableValue; | |
| import javafx.collections.FXCollections; | |
| import javafx.collections.ObservableList; | |
| import javafx.concurrent.Task; | |
| import javafx.concurrent.Worker; | |
| import javafx.event.ActionEvent; |
| (function(){ | |
| })() |
Disclaimer: This file is called .a_README.markdown so that it'll appear first
in the gist view (sorry for the horrible name)
Because this script prompts for user input, you have to execute it in a bit of an odd way. From a new command prompt simply copy and paste the following command and press return:
| #!/usr/bin/env jruby | |
| # | |
| # | |
| require 'rubygems' | |
| require 'spoon' | |
| EXEC = '/tmp/exec.rb' | |
| PID_PATH = '/tmp/exec.pid' | |
| WORK_PATH = '/tmp/' |
| require 'rubygems' | |
| require 'spoon' | |
| Spoon.spawnp 'jruby', *ARGV |
| #!/usr/bin/env jruby | |
| # | |
| # | |
| require 'rubygems' | |
| require 'spoon' | |
| EXEC = '/tmp/exec.rb' | |
| PID_PATH = '/tmp/exec.pid' | |
| WORK_PATH = '/tmp/' |
| require "thread" | |
| class BoundedQueue | |
| def initialize(max_size = :infinite) | |
| @lock = Mutex.new | |
| @items = [] | |
| @item_available = ConditionVariable.new | |
| @max_size = max_size | |
| @space_available = ConditionVariable.new | |
| end |