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
| Given I am logged in as administrator | |
| And I click on t(settings) |
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
| And /I click on t\(:?([^\)]*)\)/ do |key| | |
| find(button, text: t(key)).click | |
| 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
| def ajax_redirect_to(url) | |
| head 302, x_ajax_redirect_url: url | |
| 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
| $.ajaxSetup({ | |
| statusCode: { | |
| 302: function (response) { | |
| var redirect_url = response.getResponseHeader('X-Ajax-Redirect-Url'); | |
| if (redirect_url != undefined) { | |
| window.location.pathname = redirect_url; | |
| } | |
| } | |
| } | |
| }); |
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 ApplicationController < ActionController::Base | |
| before_filter :check_user_session, except: [:logout] | |
| def check_user_session | |
| unless valid_user? | |
| request.xhr? ? ajax_redirect_to(login_path) : redirect_to login_path | |
| 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
| class MovieOMeter | |
| include Hash19 | |
| contains :movies | |
| inject at: '$.movies', using: :movie_name, reference: :name, | |
| trigger: lambda { |names| IMDB.find_all_movie_ratings names }, as: 'ratings' | |
| inject at: '$.movies', using: :movie_name, reference: :name, | |
| trigger: lambda { |names| Twitter.search_by_terms names }, as: 'twitter_sentiments' | |
| end | |
| class Movie |
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
| curl -XPUT 127.0.0.1:9200/_template/logstash -d ' | |
| { | |
| "template" : "logstash*", | |
| "settings" : { | |
| "index.analysis.analyzer.default.type": "standard", | |
| "index.compress.stored": true, | |
| "index.merge.policy.max_merged_segment": "5g", | |
| "index.query.default_field": "@message", | |
| "index.refresh_interval": "2s", | |
| "index.term_index_divisor": 1, |
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
| $ curator show indices — older-than 90 — time-unit days — timestring ‘%Y.%m.%d’ | |
| $ curator snapshot — repository s3-backup indices — older-than 90 — time-unit days — timestring ‘%Y.%m.%d’ | |
| $ curator delete indices — older-than 90 — time-unit days — timestring ‘%Y.%m.%d’ |
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
| $ curl -XPUT 'http://localhost:9200/_snapshot/s3-backup' -d ' | |
| {"type": "s3", | |
| "settings": { | |
| "bucket": "logstash-backup", | |
| "region": "us-west-2", | |
| "access_key": "A4z43slikeiwouldtellyouAUU12", | |
| "secret_key": "1PNaNotSoSecretIGuessOZEQa" | |
| }}' |
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
| 2015–11–16 15:39:26,701 INFO Job starting: snapshot indices | |
| 2015–11–16 15:39:26,702 WARNING Overriding default connection timeout. New timeout: 21600 | |
| 2015–11–16 15:39:26,721 INFO Adding logstash-2015.08.19 from command-line argument | |
| 2015–11–16 15:39:26,721 INFO Action snapshot will be performed on the following indices: [u’logstash-2015.08.19'] | |
| 2015–11–16 15:39:26,972 INFO Snapshot name: curator-20151116153926 | |
| 2015–11–16 15:39:35,780 INFO Snapshot curator-20151116153926 successfully completed. | |
| 2015–11–16 15:39:35,780 INFO Job completed successfully. |