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
{ | |
"access": { | |
"token": { | |
"id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", | |
"expires": "2014-11-24T22:05:39.115Z", | |
"tenant": { | |
"id": "110011", | |
"name": "110011" | |
}, | |
"RAX-AUTH:authenticatedBy": [ |
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
# TO_FOLDER=/something | |
# FROM=/your-es-installation | |
DATE=`date +%Y-%m-%d_%H-%M` | |
TO=$TO_FOLDER/$DATE/ | |
echo "rsync from $FROM to $TO" | |
# the first times rsync can take a bit long - do not disable flusing | |
rsync -a $FROM $TO | |
# now disable flushing and do one manual flushing |
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
{ | |
"query": { | |
"filtered": { | |
"query": { | |
"match_all": {} | |
}, | |
"filter": { | |
"bool": { | |
"must_not": [ | |
{"term": {"topic_ids": "NTfaluJAzhU6ajVN"}}, |
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
stylesheets_path = File.join(Rails.root, 'public', 'stylesheets') | |
Dir.glob("#{stylesheets_path}/*/**/*.css").each do |css_file| | |
data = File.read(css_file) | |
matches = data.scan(/url\([\s"']*([^\)"'\s]*)[\s"']*\)/m).collect do |match| | |
match.first | |
end | |
uniq_matches = matches.uniq | |
report_matches = {} | |
unless uniq_matches.blank? | |
matches.uniq.each do |match| |
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
require 'httparty' | |
class Walkscore | |
include HTTParty | |
default_params :format => 'json' | |
attr_accessor :api_key, :property | |
def initialize(api_key, property) | |
self.api_key = api_key |
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
ProductsController.class_eval do | |
respond_to :html, :js | |
def show | |
product_source = Product.find_by_permalink!(params[:id]) | |
@product = ProductDecorator.new(product_source) | |
return unless @product | |
if params[:option_values] | |
option_values_ids = [ |
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
module Sunspot | |
module SessionProxy | |
class NamespacedSessionProxy | |
class MultipleConnectionsError < StandardError | |
def initialize | |
super("Can not perform operations against multiple namespaced (connections)") | |
end | |
end | |
class NotImplementedError < StandardError | |
def initialize |
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
require 'spec_helper' | |
inputs = [:path, :hash, :file, :tempfile, :stringio] | |
outputs = [:path, :file, :tempfile, :stringio, :nil] | |
def get_input(input_type, file_name = 'fields.pdf') | |
case input_type | |
when :path | |
path_to_pdf(file_name) | |
when :hash |
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
check process sequoia_dj2_delayed_job_0 | |
with pidfile /home/deploy/rails/sequoia/shared/pids/delayed_job.0.pid | |
start program = "/home/deploy/rails/sequoia/shared/delayed_job_runner.sh start production 0" | |
as uid deploy and gid deploy | |
stop program = "/home/deploy/rails/sequoia/shared/delayed_job_runner.sh stop production 0" | |
as uid deploy and gid deploy | |
check process sequoia_dj2_delayed_job_1 | |
with pidfile /home/deploy/rails/sequoia/shared/pids/delayed_job.1.pid | |
start program = "/home/deploy/rails/sequoia/shared/delayed_job_runner.sh start production 1" |
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
class FollowsController < ApplicationController | |
def create | |
@followable = find_followable | |
@follower = find_follower | |
@follower.follow(@followable) | |
redirect_to (@followable) | |
end | |
def destroy |
NewerOlder