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 UISpec | |
class UI < UIDefinition | |
def initialize(out) | |
super(out, "", "x.exe") | |
end | |
has_tab :slide_setup, {:name => "Slide Setup Tab", :action => show(:slide_setup_screen) } | |
has_screen :slide_setup_screen do |
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 'ruby2ruby' | |
def refactor(type, method, new_method) | |
m2 = Ruby2Ruby.translate(type, method).gsub("def #{method}", "def #{new_method}") | |
type.class_eval("remove_method method\n#{m2}") | |
end | |
class X | |
def z | |
5 |
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
# I want to say all four tabs have the same set of fields | |
has_dialog :add_reagent_dialog do | |
def is_a_staining_tab # I don't like this! | |
has_drop_down :default_staining_protocol1 | |
has_drop_down :default_staining_protocol2 | |
has_drop_down :default_staining_protocol3 | |
has_drop_down :default_staining_protocol4 | |
end |
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
# this fails "Mock 'x' expected :a with (any args) once, but received it twice" | |
x = mock("x") | |
x.should_receive(:a).ordered | |
x.should_receive(:b).ordered | |
x.should_receive(:a).ordered | |
x.a | |
x.b | |
x.a |
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
Given I am logged in as <Role> | |
And I have a Protocol <Initial Protocol Details> | |
When I clone the protocol | |
Then the new protocol will contain <Cloned Protocol Details> | |
Examples: | |
*| Role | Initial Protocol Details ||| Cloned Protocol Details ||| | |
*| | Name | Urgent | Description | Name | Urgent | Description | |
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
Given I am a <role> | |
And I am on the entity list screen | |
When I <action> an <state> entity | |
Then control1 is <control1> | |
And control2 is <control2> | |
And control3 is <control3> | |
Examples: | |
| role | action | state | control1 | control2 | control3 | | |
| Admin | [Edit|View] | [new|expired] | Enabled | Enabled | Disabled | |
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
find *.mp3 | ruby -e 'while(x=gets) do `mp3faster \"#{x.chomp}\"`;end' |
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
#\ -w -p 8765 | |
use Rack::Reloader, 0 | |
use Rack::ContentLength | |
use Rack::ShowExceptions | |
map "/cuce" do |path| | |
run Proc.new{ | |
command = "cucumber.bat features/nav.feature -f html" | |
out = `#{command} 2>&1` | |
[ 200, {'Content-Type' => out=~/\<html/ ? 'text/html' : 'text/plain'}, out ] |
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 'memcached' | |
# Provides a hybrid of memoization and memcacheing. Designed for storing an entire (small) | |
# table in memory, in every instance of the app. Works well for reference-type tables | |
# (e.g., Category) which won't ever get big or change often, but are read-heavy. This | |
# allows you to avoid joins, but also avoid the n+1 queries antipattern. | |
# | |
# A pure memoization solution fails when the data *does* change -- all app instances have | |
# to be restarted for the in-memory caches to be correct. A pure memcached solution solves | |
# that, but requires a largish amount of data to be retrieved from memcached for every |
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
Imports System | |
Imports EnvDTE | |
Imports EnvDTE80 | |
Imports EnvDTE90 | |
Imports System.Diagnostics | |
Public Module Module1 | |
Sub StoryQConvert() | |
Dim textSelection As String |
OlderNewer