I hereby claim:
- I am mreinsch on github.
- I am mreinsch (https://keybase.io/mreinsch) on keybase.
- I have a public key ASBVOsqAmcvVZvk1rJpx4KPv4M0AwbFBKtG-3t1zSkNRrgo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
module CapybaraHelperMethods | |
def wait_for_ajax | |
counter = 0 | |
while !finished_all_ajax_requests? | |
counter += 1 | |
sleep 0.2 | |
raise "AJAX request took too long." if counter >= (Capybara.default_wait_time * 5) | |
end | |
end |
module RSpecLoggerListener | |
extend self | |
def start(notification) | |
Rails.logger.info("\n\n====== Starting new test run") | |
end | |
def stop(notification) | |
Rails.logger.info("\n\n====== Test run finished") | |
end | |
def example_started(notification) |
$ git branch -r --merged master | | |
awk -F'/' '/^ *origin/{if(!match($0, /(>|master)/)){print $2}}' | | |
xargs git push origin --delete |
class Event < ActiveRecord::Base | |
include Elasticsearch::Model | |
belongs_to :group | |
after_save { IndexerJob.perform_later('update', self.class.name, self.id) } | |
after_destroy { IndexerJob.perform_later('delete', self.class.name, self.id) } | |
def in_search_index? | |
published? && group.in_search_index? |
# some helpers to make integration testing with elasticsearch easier | |
# expects Capybara | |
# modify this! | |
MODELS_WITH_ELASICSEARCH_MODEL = [Group, Event] | |
begin | |
MODELS_WITH_ELASICSEARCH_MODEL.each do |c| | |
c.__elasticsearch__.create_index! force: true | |
c.__elasticsearch__.refresh_index! |
Verifying I am +mreinsch on my passcard. https://onename.com/mreinsch |
#!/bin/bash | |
ES_VERSION="1.1.1" | |
ES_PORT="9333" | |
PWD=`pwd` | |
mkdir -p ~/elasticsearch/ | |
cd ~/elasticsearch/ | |
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-${ES_VERSION}.zip |
# put this in /usr/local/Library/Taps/homebrew/homebrew-versions/elasticsearch10.rb | |
# $ ln -s ../Taps/homebrew/homebrew-versions/elasticsearch10.rd /usr/local/Library/Formula/elasticsearch10.rb | |
# $ brew install elasticsearch10 | |
require 'formula' | |
class Elasticsearch10 < Formula | |
homepage 'http://www.elasticsearch.org' | |
url 'https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.0.1.tar.gz' | |
sha1 '26bcf8e36576b2f3809ab84432ea005f893836b9' |
class ContactMailer < ActionMailer::Base | |
def receive(email) | |
ContactMailer.contact_admins(email).deliver | |
end | |
def contact_admins(orig_email) | |
m = mail(to: 'info@doorkeeper.jp', subject: 'Received email') do |format| | |
format.text { render } | |
format.html { render } |