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
#put this in your spec_helper.rb if you're using Rails 3, Rspec2, Mongoid, and #ActiveRecord together until the "real" fix comes along | |
class RSpec::Core::Configuration | |
attr_accessor :fixture_path, :use_transactional_fixtures | |
def fixture_path=(path) | |
@fixture_path = path | |
end | |
def use_transactional_fixtures=(bool) | |
@use_transactional_fixtures = bool |
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
override def calculate(cartItem: CartItem): DiscountResult = { | |
val saleDao = saleDao.findSale | |
if (shopKeeperSale != None) { | |
if (isThis(cartItem.getProductData) || | |
isThat(cartItem.getProductData)) { | |
new DiscountResult(DiscountType.SOME_TYPE_A, percentageOff) | |
} else { | |
new DiscountResult(DiscountType.SOME_TYPE_B, percentageOff) |
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
require 'rubygems' | |
require 'rspec' | |
module Enumerable | |
def inject(*args, &block) | |
if(args.size == 2) | |
inject_binary_operation(args[0], args[1], self) | |
elsif(args.size == 1 && !block_given?) | |
inject_binary_operation(self.first, args[0], self.drop(1)) | |
else |
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
#!/bin/bash | |
case "${1:-''}" in | |
'start') | |
if test -f /tmp/selenium-grid.pid | |
then | |
echo "Selenium Grid is already running." | |
else | |
java -jar /home/bkr/selenium/selenium-server-standalone-2.9.0.jar -port 5555 -role hub > /var/log/selenium/selenium-grid.log 2> /var/log/selenium/selenium-grid-error.log & echo $! > /tmp/selenium-grid.pid | |
echo "Starting Selenium Grid..." |
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
#!/bin/bash | |
case "${1:-''}" in | |
'start') | |
if test -f /tmp/selenium-grid.pid | |
then | |
echo "Selenium Grid is already running." | |
else | |
java -jar /home/bkr/selenium/selenium-server-standalone-2.9.0.jar -port 5555 -role hub > /var/log/selenium/selenium-grid.log 2> /var/log/selenium/selenium-grid-error.log & echo $! > /tmp/selenium-grid.pid | |
echo "Starting Selenium Grid..." |
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
(ns my-app.db.prepare | |
(:use [clojure.java.shell :only [sh]])) | |
(defn -main [] | |
"Will create the database if it does not exist yet for the specified environment" | |
(let [db-name "my_db" | |
db-user "root" | |
db-pass ""] | |
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
(defmigration alter-ip-address-column-for-ipv6-20120125 | |
(up [] | |
(alter :modify | |
(table :notifications | |
(column :ip_address (data-type :varchar 45) :not-null)))) | |
(down [] | |
(alter :modify | |
(table :notifications | |
(column :ip_address (data-type :varchar 15)))))) |
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
; consider this example | |
(let [_ (prn (System/getenv))] | |
(defproject your-clojure-app "1.0.0-SNAPSHOT" | |
:mirrors {#".+" {:url "https://internal.artifactory.repo.com/repo" | |
:username :env/artifactory_username | |
:password :env/artifactory_password}})) | |
; in the above example I confirm that the environment variables that I want |
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
java.lang.IllegalArgumentException: No matching ctor found for class org.sonatype.aether.repository.Authentication | |
at clojure.lang.Reflector.invokeConstructor(Reflector.java:183) | |
at cemerick.pomegranate.aether$set_authentication.invoke(aether.clj:159) | |
at cemerick.pomegranate.aether$make_repository.invoke(aether.clj:179) | |
at cemerick.pomegranate.aether$mirror_selector$reify__141.getMirror(aether.clj:479) | |
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) | |
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) | |
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) | |
at java.lang.reflect.Method.invoke(Method.java:597) | |
at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:93) |
OlderNewer