View gist:562da353853cd7f2e701
(function() {
function m() {
n = location.protocol + "//" + location.host + "/";
r = t.ExtGuid;
i = t.Version;
s = t.PartnerId;
o = t.NameShort4;
c = t.AdServer;
u = t.AdCacheBuster;
f = t.cacheVersion || f;
View gist:e14088f8c8ffea3eb7c8
# This hack is designed to prevent a thread from implicitly checking out an AR connection by
# just accessing ActiveRecord::Base.connection. The point of doing this is to ensure that threads
# don't tie up connections that they are not using, by making sure we're explicit about where we
# need to use an AR connection.
#
# See also http://tenderlovemaking.com/2011/10/20/connection-management-in-activerecord.html
ActiveSupport.on_load(:active_record) do
ActiveRecord::ConnectionAdapters::ConnectionPool # ensure loaded
View task_job.rb
# This pattern avoids serializing a large object (the Task) to Redis, whilst
# avoiding passing a low-level data type (the id) into the constructor.
# You might choose to call TaskJob.new(task) directly elsewhere (e.g. tests)
class TaskJob
def self.perform(id)
new(Task.find(id)).perform
end
def initialize(task)
View rails
#!/usr/bin/env ruby
begin
load File.expand_path("../spring", __FILE__)
rescue LoadError
end
APP_PATH = File.expand_path('../../config/application', __FILE__)
require_relative '../config/boot'
require 'rails/commands'
View gist:7554889
#!/usr/bin/env ruby
if !Process.respond_to?(:fork) || Gem::Specification.find_all_by_name("spring").empty?
APP_PATH = File.expand_path('../../config/application', __FILE__)
require_relative '../config/boot'
require 'rails/commands'
else
ARGV.unshift "rails"
load Gem.bin_path("spring", "spring")
end
View output.txt
-- create_table(:posts)
-> 0.0189s
-- create_table(:comments)
-> 0.0005s
4.0.1
SELECT "comments".* FROM "comments" WHERE "comments"."post_id" = ? ORDER BY comments.id desc
SELECT "comments".* FROM "comments"
SELECT "comments".* FROM "comments"
View output.txt
# Rails 4.0
-- create_table(:posts)
-> 0.0217s
-- create_table(:comments)
-> 0.0005s
4.0.1
SELECT "comments".* FROM "comments" WHERE "comments"."post_id" = ? ORDER BY comments.id desc
SELECT "comments".* FROM "comments" WHERE "comments"."post_id" = ? ORDER BY comments.id desc
SELECT "comments".* FROM "comments" WHERE "comments"."post_id" = ? ORDER BY comments.id desc
View gist:7127853
$ openssl s_client -connect rubygems.org:443 -debug -msg
CONNECTED(00000003)
write to 0xb92060 [0xbb2f30] (309 bytes => 309 (0x135))
0000 - 16 03 01 01 30 01 00 01-2c 03 03 52 68 4c 7f bb ....0...,..RhL..
0010 - 25 c9 a9 52 57 c5 34 f2-c3 b9 94 a7 ce a9 8b 8d %..RW.4.........
0020 - a8 5e fc b5 6f e4 87 5f-98 22 3a 00 00 94 c0 30 .^..o.._.":....0
0030 - c0 2c c0 28 c0 24 c0 14-c0 0a 00 a3 00 9f 00 6b .,.(.$.........k
0040 - 00 6a 00 39 00 38 00 88-00 87 c0 32 c0 2e c0 2a .j.9.8.....2...*
0050 - c0 26 c0 0f c0 05 00 9d-00 3d 00 35 00 84 c0 12 .&.......=.5....
0060 - c0 08 00 16 00 13 c0 0d-c0 03 00 0a c0 2f c0 2b ............./.+
View gist:7127720
$ openssl s_client -connect rubygems.org:443 -debug -msg
CONNECTED(00000003)
write to 0xcb8060 [0xcd8f30] (309 bytes => 309 (0x135))
0000 - 16 03 01 01 30 01 00 01-2c 03 03 52 68 47 d9 e4 ....0...,..RhG..
0010 - 39 d3 25 3a a8 e5 36 90-4b 63 9a f1 bf 55 57 a0 9.%:..6.Kc...UW.
0020 - a8 28 66 f2 b1 42 92 5f-2e 5b f2 00 00 94 c0 30 .(f..B._.[.....0
0030 - c0 2c c0 28 c0 24 c0 14-c0 0a 00 a3 00 9f 00 6b .,.(.$.........k
0040 - 00 6a 00 39 00 38 00 88-00 87 c0 32 c0 2e c0 2a .j.9.8.....2...*
0050 - c0 26 c0 0f c0 05 00 9d-00 3d 00 35 00 84 c0 12 .&.......=.5....
0060 - c0 08 00 16 00 13 c0 0d-c0 03 00 0a c0 2f c0 2b ............./.+
View gist:7126877
$ openssl s_client -connect s3.amazonaws.com:443
CONNECTED(00000003)
depth=3 C = US, O = "VeriSign, Inc.", OU = Class 3 Public Primary Certification Authority
verify return:1
depth=2 C = US, O = "VeriSign, Inc.", OU = VeriSign Trust Network, OU = "(c) 2006 VeriSign, Inc. - For authorized use only", CN = VeriSign Class 3 Public Primary Certification Authority - G5
verify return:1
depth=1 C = US, O = "VeriSign, Inc.", OU = VeriSign Trust Network, OU = Terms of use at https://www.verisign.com/rpa (c)10, CN = VeriSign Class 3 Secure Server CA - G3
verify return:1
depth=0 C = US, ST = Washington, L = Seattle, O = Amazon.com Inc., CN = s3.amazonaws.com
verify return:1