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
# I don't think these database names are wrong, but you should be able to get the idea | |
class ActiveRecord::Migration | |
def self.whSalesDbName | |
return "DevSalesDb" if(ENV['NODE_ENV'] != "production") | |
return "SalesDb" | |
end | |
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
/** | |
* The base class for models. | |
* | |
* @param <T> The type of the model under test. | |
*/ | |
public abstract class ModelTestBase<T extends Serializable> { | |
/** | |
* Responsible for generating a test instance. | |
* |
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
// The first time you run this, it will take a very long, annoyingly silent pause while it loads libraries | |
@Grapes([ | |
@Grab("org.gebish:geb-core:0.9.3"), | |
@Grab("org.seleniumhq.selenium:selenium-firefox-driver:2.41.0"), | |
@Grab("org.seleniumhq.selenium:selenium-support:2.41.0") | |
]) | |
import geb.Browser | |
Browser.drive { |
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
<!-- | |
In your SCSS file: | |
.bootstrap { | |
// All your bootstrap specific SCSS here | |
} | |
--> | |
<body class="bootstrap"> | |
<!-- | |
Widgets here will get "bootstrap"-namespaced styling |
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
tmp$ lazybones list --cached | |
Cached templates | |
ext-geb 1.0.0 | |
lazybones-project 1.0.1 | |
tmp$ lazybones create ext-geb folder1 | |
Creating project from template ext-geb (latest) in 'folder1' | |
Cannot find a template named 'ext-geb'. Project has not been created. |
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
lazybones$ gradle -i --stacktrace publishAllTemplates | |
Starting Build | |
Settings evaluated using empty settings script. | |
Projects loaded. Root project using build file '/Users/RCFischer/webonise/lazybones/build.gradle'. | |
Included projects: [root project 'lazybones'] | |
Evaluating root project 'lazybones' using build file '/Users/RCFischer/webonise/lazybones/build.gradle'. | |
All projects evaluated. | |
Selected primary task 'DefaultTaskParameter{taskName='publishAllTemplates',projectPath='null'}' | |
Tasks to be executed: [task ':packageTemplateExtGeb', task ':publishTemplateExtGeb', task ':publishAllTemplates'] | |
:packageTemplateExtGeb (Thread[main,5,main]) started. |
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
String signUp(Map namedArgs = [:], String firstName = 'Test', String lastName = 'User') { | |
namedArgs = namedArgs ?: [:] // In case they passed null to be a stinker | |
email = '[email protected]' | |
bothPasswords = "password" | |
setFullName(firstName, lastName) | |
organisation = namedArgs.remove('organisation') ?: "Webonise Farm" | |
phoneNumber = namedArgs.remove('phoneNumber') ?: "8001234567" | |
optionalTextingNumber = namedArgs.remove('optionalTextingNumber') ?: null | |
address = namedArgs.remove('address') ?: "9001 Glenwood Ave" | |
apartment = namedArgs.remove('apartment') ?: "100" |
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
/* | |
Three functions: | |
One if the message is hard-coded. | |
One if the message is provided entirely by the user. | |
One if the message needs a suffix provided by the user. | |
You could also create a function that used JavaScript's sprintf | |
and the arguments object (cast to an object by _.toArray()) for | |
truly flexible error messaging. That is left as an exercise for | |
the team. |
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
class SamplePage { | |
static theResultDivImpl = { /* Your impl here */ } | |
static at = { /* Your basic test here */ && waitFor(theResultDivImpl) } | |
static content = { | |
theResultDiv(wait:true, theResultDivImpl) | |
} | |
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
scala> var opt = Some("Foo") | |
opt: Some[String] = Some(Foo) | |
So far, so good. I want to get the value from my Some. Checking the API for Option, and there's a .get() to retrieve the value — http://www.scala-lang.org/api/current/index.html#scala.Option | |
scala> opt.get() | |
<console>:9: error: not enough arguments for method apply: (index: Int)Char in class StringOps. | |
Unspecified value parameter index. | |
opt.get() | |
^ |