Open the postgresql.conf config file:
$> mate /usr/local/var/postgres/postgresql.conf
Uncomment the line with 'log_destination' and set it to 'syslog'
log_destination = 'syslog'
Open the syslog config:
# Rails.root/config.ru | |
require "./config/environment" | |
run ActionController::Dispatcher.new |
require "csv" | |
class HerokuEnvLogger | |
PREFIX = "HerokuRequest" | |
TIME_STEP = 1.minute * 1000 # ms | |
EXPIRE_IN = 6.hours | |
KEYS = %w[HTTP_X_REQUEST_START | |
HTTP_X_HEROKU_QUEUE_WAIT_TIME | |
HTTP_X_HEROKU_QUEUE_DEPTH | |
HTTP_X_HEROKU_DYNOS_IN_USE] |
# ======================================== | |
# Testing n-gram analysis in ElasticSearch | |
# ======================================== | |
curl -X DELETE localhost:9200/ngram_test | |
curl -X PUT localhost:9200/ngram_test -d ' | |
{ | |
"settings" : { | |
"index" : { | |
"analysis" : { |
Open the postgresql.conf config file:
$> mate /usr/local/var/postgres/postgresql.conf
Uncomment the line with 'log_destination' and set it to 'syslog'
log_destination = 'syslog'
Open the syslog config:
# config/initializers/app_config.rb | |
# An initializer that contains config stuff | |
# ... | |
class RedisConfig < Settingslogic | |
source "#{Rails.root}/config/redis.yml" | |
namespace Rails.env | |
end |
class Api::RegistrationsController < Api::BaseController | |
respond_to :json | |
def create | |
user = User.new(params[:user]) | |
if user.save | |
render :json=> user.as_json(:auth_token=>user.authentication_token, :email=>user.email), :status=>201 | |
return | |
else |
Array.prototype.to_sentence = function() { | |
return this.join(", ").replace(/,\s([^,]+)$/, ' and $1') | |
} |
# ... | |
gem 'carrierwave' | |
gem 'fog', '~> 1.0.0' # Need to specify version, as carrierwave references older (0.9.0) which doesn't allow configuration of Rackspace UK Auth URL |
BUNDLED_COMMANDS=(rails rake rspec ruby sass sass-convert spec spork) | |
is-bundler-installed() | |
{ | |
which bundle > /dev/null 2>&1 | |
} | |
is-within-bundled-project() | |
{ | |
local dir="$(pwd)" |