View log.log
> r!;ShareEmail.perform(Offer.last, 'A A <>', nil, nil, nil, nil)
Offer Load (0.3ms) SELECT `offers`.* FROM `offers` ORDER BY `offers`.`id` DESC LIMIT 1
Campaign Load (0.3ms) SELECT `campaigns`.* FROM `campaigns` WHERE `campaigns`.`id` = 37228 LIMIT 1
Site Load (0.3ms) SELECT `sites`.* FROM `sites` WHERE `sites`.`id` = 2901 LIMIT 1
Person Load (0.3ms) SELECT `people`.* FROM `people` WHERE `people`.`site_id` = 2901 AND `people`.`email` = ''
CustomAttribute Load (0.3ms) SELECT `custom_attributes`.* FROM `custom_attributes` WHERE `custom_attributes`.`foreign_id` = 18425477 AND `custom_attributes`.`model` = 'Person'
Mailgun Batch Email Validation: passed - 1, failed - 0, total - 1
Account Load (0.2ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`id` = 4416 LIMIT 1
Person Load (0.5ms) SELECT `people`.* FROM `people` INNER JOIN `offer_shares` ON `people`.`id` = `offer_shares`.`person_id` WHERE `offer_shares`.`type` IN ('Em
View fuzzy_string_matcher_spec.rb
require "spec_helper"
describe FuzzyStringMatcher do
context ".similar?" do
RSpec::Matchers.define :be_similar do
match {|val| FuzzyStringMatcher.similar?(*val) }
FALSE_POSITIVE = <<-HEREDOC.lines.reject(&:blank?).map {|x| x.strip.split(", ") }
greg.dellolio, doug.dellolio
View New specs

Singleton Factories

Ability to limit data generation to certain site, campaign or offer without caring explicitly that data is bound to same campaign or site etc.

Singleton values:

  • site
  • campaign
  • offer
View gist:341836bcc2917e959912cda3c3782311
$ cap -r web production utils:execute COMMAND='ls -hla /home/rails/talkable/current/log/nginx-access.log-2016080*'
web02.production: -rw-r--r-- 1 rails root 274M Aug 1 06:48 /home/rails/talkable/current/log/nginx-access.log-20160801.gz
web02.production: -rw-r--r-- 1 rails root 253M Aug 2 06:36 /home/rails/talkable/current/log/nginx-access.log-20160802.gz
web02.production: -rw-r--r-- 1 rails root 271M Aug 3 06:32 /home/rails/talkable/current/log/nginx-access.log-20160803.gz
web02.production: -rw-r--r-- 1 rails root 255M Aug 4 06:39 /home/rails/talkable/current/log/nginx-access.log-20160804.gz
web02.production: -rw-r--r-- 1 rails root 256M Aug 5 06:27 /home/rails/talkable/current/log/nginx-access.log-20160805.gz
web02.production: -rw-r--r-- 1 rails root 250M Aug 6 06:52 /home/rails/talkable/current/log/nginx-access.log-20160806.gz
web02.production: -rw-r--r-- 1 rails root 248M Aug 7 06:52 /home/rails/talkable/current/log/nginx-access.log-20160807.gz
web02.production: -rw-r--r-- 1 rails root 297M Aug 8
View markdown.snippets
snippet cc "code"
``` ${1}
snippet rb "rb"
``` ruby
View gist:a097ef3d7df06c0045cc6ed335627805
diff --git a/spec/js_routes/rails_routes_compatibility_spec.rb b/spec/js_routes/rails_routes_compatibility_spec.rb
index ff0a480..6f027f7 100644
--- a/spec/js_routes/rails_routes_compatibility_spec.rb
+++ b/spec/js_routes/rails_routes_compatibility_spec.rb
@@ -93,6 +93,14 @@ describe JsRoutes, "compatibility with Rails" do
it "should support single route mapping" do
expect(evaljs("Routes.support_path({page: 3})")).to eq(routes.support_path(:page => 3))
+ describe "anonymous" do
View sweeperzz.rb
module Check_position
def check_position(x, y)
if @board[x][y] == 'b'
return 'b'
# Counter can be cached.
# That is optional to do but is a big +
counter(x, y)
View action_mailer_optional_tls.rb
require 'open-uri'
require 'net/https'
module Net
class HTTP
alias_method :original_use_ssl=, :use_ssl=
def use_ssl=(flag)
# Ubuntu
if File.exists?('/etc/ssl/certs')
View site.rb
def custom_domain_up_new?
return false unless custom_domain.present? do |dns|
dns.timeouts = 2
# Querying each type of record individually
# Because ANY query may not return all required types
Resolv::DNS::Resource::IN::CNAME => /(talkable|curebit)\.com$/,
Resolv::DNS::Resource::IN::NS => /ns-\d+.awsdns-\$/,
}.any? do |type, regex|
View .irbrc
require 'rubygems'
require 'logger'
require "net/http"
irb_conf = defined?(::IRB) && IRB.respond_to?(:conf)
load File.dirname(__FILE__) + "/.rubyrc/bogdan.rb"
if irb_conf