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
syntax on | |
colo murphy | |
set nu | |
set tabstop=8 softtabstop=0 expandtab shiftwidth=2 smarttab | |
set ignorecase | |
set backspace=indent,eol,start | |
" Set utf8 as standard encoding and en_US as the standard language | |
set encoding=utf8 |
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
irb(main):002:0> a.password = 'Qa123456' | |
=> "Qa123456" | |
irb(main):003:0> a.password_confirmation = 'Qa123456' | |
=> "Qa123456" | |
irb(main):004:0> a.save |
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
# https://sebastianvoss.com/docker-mongodb-sharded-cluster.html | |
# rs1_srv1 172.17.0.20:49170 | |
# rs1_srv2 172.17.0.21:49171 | |
# rs1_srv3 172.17.0.22:49172 | |
# rs2_srv1 172.17.0.23:49173 | |
# rs2_srv2 172.17.0.24:49174 | |
# rs2_srv3 172.17.0.25:49175 | |
# cfg1 172.17.0.26:49176 | |
# mongos1 172.17.0.27:49177 |
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
root = "/var/www/cake/current" | |
working_directory root | |
pid "#{root}/tmp/pids/unicorn.pid" | |
stderr_path "#{root}/log/unicorn.stderr.log" | |
stdout_path "#{root}/log/unicorn.log" | |
listen "/tmp/unicorn.cake.sock" | |
worker_processes 2 | |
timeout 15 |
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
Resque::Failure.all(Resque::Failure.count-5,5).each { |job| puts "#{job["exception"]} #{job["backtrace"]}" } | |
fail_counts = {} | |
Resque::Failure.all(0,Resque::Failure.count).each do |job| | |
if fail_counts[job['queue']] | |
fail_counts[job['queue']] += 1 | |
else | |
fail_counts[job['queue']] = 1 | |
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
module Devise | |
module Strategies | |
class MyAuthenticatable < Authenticatable | |
def authenticate! | |
begin | |
if resp = authenticate_local | |
else | |
fail!('Invalid username or password') |
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
[vagrant@localhost ~]$ yum list freetds | |
Loaded plugins: fastestmirror, security | |
Determining fastest mirrors | |
* base: mirrors.seas.harvard.edu | |
* epel: linux.mirrors.es.net | |
* extras: centos.mirror.netriplex.com | |
* updates: mirror.pac-12.org | |
Installed Packages | |
freetds.x86_64 0.91-2.el6 @epel | |
Available Packages |
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 B | |
def self.included(base) | |
class << base | |
attr_accessor :catch | |
def acts_as_catchall(hsh) | |
@catch = hsh | |
end | |
def inherited(subclass) | |
subclass.catch = subclass.superclass.catch |
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 B | |
def self.included(base) | |
class << base | |
attr_accessor :catch | |
def acts_as_catchall(hsh) | |
self.catch = hsh | |
end | |
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
module ActsAsCatchall | |
def self.included(base) | |
base.extend ClassMethods | |
end | |
module ClassMethods | |
class << self; attr_accessor :catchall end | |
def acts_as_catchall(options = {}) | |
# db_field, klass, use_method_missing = false |
NewerOlder