View elasticsearch1.7.rb
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
# in the terminal run brew install elasticsearch1.7.rb | |
class Elasticsearch17 < Formula | |
desc "Distributed search & analytics engine" | |
homepage "https://www.elastic.co/products/elasticsearch" | |
url "https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.7.6.tar.gz" | |
sha256 "78affc30353730ec245dad1f17de242a4ad12cf808eaa87dd878e1ca10ed77df" | |
revision 1 | |
bottle :unneeded |
View 0_reuse_code.js
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
View alias_for_staging.rb
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
WebSite.all.each do |web_site| | |
next if web_site.s_id == 'evan_site_test' | |
begin | |
puts "checking for actual index..." | |
response = UserSession.__elasticsearch__.client.perform_request('HEAD',web_site.namespaced_user_session_index_name,{}) | |
UserSession.__elasticsearch__.client.perform_request('POST', '_aliases',{}, {actions: [{ add: { index: web_site.namespaced_user_session_index_name, alias: UserSession.index_name}}]}) | |
rescue | |
puts "index not found" | |
puts "checking for alias" | |
begin |
View Mongo MapReduce Debugger
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
var values = [] | |
var map = function() { | |
emit(key, value); | |
}; | |
var emit = function(key,value){ | |
// print("key: "+ tojsononeline(key) +" value: "+ tojsononeline(value)); | |
output = {"_id": key, value: value} | |
print(output) |
View content-travis
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
language: ruby | |
bundler_args: --without development --quiet --path=~/.bundle | |
rvm: | |
- 2.0.0 | |
services: | |
- elasticsearch | |
before_install: | |
- chmod -R 777 ./script/travis | |
- 'echo ''gem: --no-ri --no-rdoc'' > ~/.gemrc' |
View git workflow
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
h2. Feature Development | |
h3. Basic Steps | |
<ol> | |
<li>Pull to update your local Release Branch</li> | |
<li>Check out a feature branch</li> | |
<li>Do work in your feature branch, committing early and often</li> | |
<li>Rebase frequently to incorporate upstream changes</li> | |
<li>Interactive rebase (squash) your commits</li> |
View refactor_search
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
def generate_search_criteria(params) | |
#REFACTOR - Should be moved into the model and scoped | |
conditions = [] | |
collection = Collection.find(params[:collection]) | |
conditions.push("buys.id IN (#{collection.buys.collect{|x| x.eql?(collection.buys.last) ? x.id : x.id.to_s + ','}.join})") | |
conditions.push("(categories.parent_id =#{params[:category]})") unless params[:category].blank? | |
conditions.push("(regions.id =#{params[:region]})") unless params[:region].blank? | |
conditions.push("(sites.language_id =#{params[:language]})") unless params[:language].blank? | |
unless params[:workflow_status].blank? | |
case params[:workflow_status] |