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
if Rails.env.development? | |
Rails.application.assets.logger = Logger.new('/dev/null') | |
Rails::Rack::Logger.class_eval do | |
def call_with_quiet_assets(env) | |
previous_level = Rails.logger.level | |
Rails.logger.level = Logger::ERROR if env['PATH_INFO'] =~ %r{^/assets/} | |
call_without_quiet_assets(env) | |
ensure |
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
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
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
# config/initializers/logger_customizations.rb | |
# Production-only monkeypatches to make our logs awesome | |
# Monkeypatch 1 | |
# Don't log common poller-style requests, they are just noise | |
class CustomLogger < Rails::Rack::Logger | |
def initialize(app, opts = {}) | |
@app = app | |
@opts = opts | |
@opts[:silenced] ||= [] |
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 your environment file (for instance, production.rb) | |
MyAwesomeApp::Application.configure do | |
# ...lots of configuration... | |
config.action_mailer.delivery_method = Messagebus::Mailer.new(ENV['MESSAGEBUS_API_KEY']) | |
end | |
# lib/messagebus/mailer.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
class AvatarUploader < CarrierWave::Uploader::Base | |
include CarrierWave::MiniMagick | |
def extension_white_list | |
model.skip_avatar_extension_check ? nil : %w(jpg jpeg gif png bmp) | |
end | |
end |
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
#tons take from sporkmonger's webfinger github | |
require File.join(Rails.root, 'lib/webfinger/hcard') | |
require File.join(Rails.root, 'lib/webfinger/webfinger_profile') | |
require 'addressable/uri' | |
require 'addressable/template' | |
require 'xrd' | |
class Webfinger | |
def self.lookup(email) | |
setup_faraday |
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 Devise | |
module Orm | |
module MongoMapper | |
module Hook | |
def devise_modules_hook! | |
extend Schema | |
include Compatibility | |
yield | |
return unless Devise.apply_schema | |
devise_modules.each { |m| send(m) if respond_to?(m, true) } |