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 Rack | |
class FirebugLogger | |
def initialize(app, options = {}) | |
@app = app | |
@options = options | |
end | |
def call(env) | |
status, headers, orig_response = @app.call(env) | |
return [status, headers, orig_response] unless (headers["Content-Type"] =~ /html/ && env['firebug.logs']) |
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
Bluepill.define_process_condition(:running_time) do | |
def initialize(options = {}) | |
@below = options[:below] | |
end | |
def run(pid) | |
started = `ps -p #{pid} -o command`.match(/since (\d+)/)[1].to_i | |
Time.now - Time.at(started) | |
rescue | |
0 |
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
ENV["PATH"] = "/opt/ruby/bin:#{ENV['PATH']}" | |
ENV["RAILS_ENV"] = "production" | |
ENV["QUEUE"] = "*" | |
Bluepill.application("nichelator") do |app| | |
app.working_dir = "/var/apps/nichelator/current" | |
app.uid = "app" | |
app.gid = "app" | |
2.times do |i| | |
app.process("resque-#{i}") do |process| |
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
#MySQL Client | |
ln -s /Application/MySQL\ Workbench.app/Contents/Resources/mysql /usr/bin/mysql | |
#MySQL Dump | |
ln -s /Application/MySQL\ Workbench.app/Contents/Resources/mysqldump /usr/bin/mysqldump |
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
"Color:Background" = "rgb(11051,11051,11051)"; | |
"Color:Background:Grep Replace Pattern" = "rgb(62915,62915,62915)"; | |
"Color:Background:Grep Search Pattern" = "rgb(62915,62915,62915)"; | |
"Color:CTagsIdentifier" = "rgb(48776,20456,15006)"; | |
"Color:ColorAttributesSeparately" = 1; | |
"Color:Comment" = "rgb(26214,26214,26214)"; | |
"Color:Comment:Markdown" = "rgb(43036,43036,43036)"; | |
"Color:Foreground" = "rgb(59110,57825,56540)"; | |
"Color:Foreground:Grep Replace Pattern" = "rgb(0,0,0)"; | |
"Color:Foreground:Grep Search Pattern" = "rgb(0,0,0)"; |
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
# This file goes in config/initializers | |
require 'bootstrap_form_builder' | |
# Make this the default Form Builder. You can delete this if you don't want form_for to use | |
# the bootstrap form builder by default | |
ActionView::Base.default_form_builder = BootstrapFormBuilder::FormBuilder | |
# Add in our FormHelper methods, so you can use bootstrap_form_for. | |
ActionView::Base.send :include, BootstrapFormBuilder::FormHelper |
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 'gollum/frontend/app' | |
require 'digest/sha1' | |
class App < Precious::App | |
User = Struct.new(:name, :email, :password_hash) | |
before { authenticate! } | |
helpers do | |
def authenticate! |
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 Strategies | |
class RemoteAuthenticatable < Authenticatable | |
# | |
# For an example check : https://github.com/plataformatec/devise/blob/master/lib/devise/strategies/database_authenticatable.rb | |
# | |
# Method called by warden to authenticate a resource. | |
# | |
def authenticate! | |
# |
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
# Rake task to launch multiple Resque workers in development/production with simple management included | |
require 'resque/tasks' # Require Resque tasks | |
namespace :workers do | |
# = $ rake workers:start | |
# | |
# Launch multiple Resque workers with the Rails environment loaded, | |
# so they have access to your models, etc. |
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/locales/en.yml | |
en: | |
exception: | |
show: | |
not_found: | |
title: "Not Found" | |
description: "The page you were looking for does not exists." | |
internal_server_error: | |
title: "Internal Server Error" |
OlderNewer