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
#!/bin/bash | |
# Setup and start Sauce Connect for your TravisCI build | |
# This script requires your .travis.yml to include the following two private env variables: | |
# SAUCE_USERNAME | |
# SAUCE_ACCESS_KEY | |
# Follow the steps at https://saucelabs.com/opensource/travis to set that up. | |
# | |
# Curl and run this script as part of your .travis.yml before_script section: | |
# before_script: |
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 xmlparse | |
import ( | |
"encoding/xml" | |
"fmt" | |
"io" | |
"strings" | |
"testing" | |
) |
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
# install virtualenv | |
sudo pip install virtualenv | |
cd [location of ghtools clone] | |
# Create and activate a new virtual environment | |
virtualenv venv | |
source venv/bin/activate | |
# Install the current directory in the virtual environment |
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
func findFiles(paths []string) <-chan string { | |
files := make(chan string) | |
// Start a go routine to feed the channel | |
go func(files chan <- string, paths []string) { | |
// Walk the filesystem for each path, calling the annonymous | |
// function provided for each subpath. | |
for _, path := range paths { | |
filepath.Walk(path, func(path string, info os.FileInfo, err error) error { | |
// Do not send paths if they're directories |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script type="text/javascript" src="scripts/d3.v2.js"></script> | |
<script type="text/javascript" src="scripts/jquery-1.7.2.js"></script> | |
<script type="text/javascript"> | |
var height = 400, | |
width = 800, | |
pathData, | |
theLoop, theLoopCount = 0; |
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
Scenario Outline: | |
When I search for "<query>" | |
Then I <imperative> see "<path>" in the top <n> results | |
Examples: | |
| query | imperative | path | n | | |
| jobs | should | /jobs-jobsearch | 2 | | |
| jobs | should | /find-job | 2 | | |
| job search | should | /jobs-jobsearch | 2 | | |
| find a job | should | /jobs-jobsearch | 2 | |
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
{ | |
"title": "Example title", | |
"format": "Answer", | |
"section": "Example", | |
"additional_links": [ | |
{"title": "title one", "link": "/one"}, | |
{"title": "title two", "link": "/two"} | |
] | |
} |
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
{ | |
"title": "Example title", | |
"format": "Answer", | |
"section": "Example", | |
"additional_links__title": ["title one", "title two"], | |
"additional_links__link": ["/one", "/two"] | |
} |
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
curl -XGET 'http://localhost:8983/solr/rummager/select?qt=dismax&q=bank+hoildays&fl=title%2Clink%2Cdescription%2Cformat&bq=format%3A%28transaction+OR+recommended-link%29%5E3.0&hl=true&hl.fl=description%2Cindexable_content&hl.simple.pre=HIGHLIGHT_START&hl.simple.post=HIGHLIGHT_END&start=0&rows=50&mm=75%25' |
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
curl -XGET 'http://localhost:9200/rummager/_search' -H 'Content-type: application/json' -d '{ | |
"from": 0, "size": 50, | |
"query": { | |
"bool": { | |
"must": { | |
"query_string": { | |
"fields": ["title", "description", "indexable_content"], | |
"query": "bank holidays", | |
"minimum_should_match": "75%" | |
} |