This file contains hidden or 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
| $ gem cert --add <(curl -Ls https://gist.github.com/sferik/4701180/raw/public_cert.pem) | |
| Added '/CN=sferik/DC=gmail/DC=com' | |
| $ bundle install --trust-policy MediumSecurity --path trusted_gems | |
| Fetching source index from https://rubygems.org/ | |
| Using rake (10.0.3) | |
| Using ace-rails-ap (2.0.0) | |
| Using i18n (0.6.1) | |
| Installing multi_json (1.6.1) | |
| (... many more unsigned gems install) | |
| The gem mime-types-1.21 can't be installed because the security policy didn't allow it, with the message: Couldn't verify data signature: |
This file contains hidden or 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
| $ bundle install --trust-policy MediumSecurity --path trusted_gems | |
| Fetching source index from https://rubygems.org/ | |
| Installing rake (10.0.3) | |
| Installing ace-rails-ap (2.0.0) | |
| Installing i18n (0.6.1) | |
| The gem multi_json-1.6.1 can't be installed because the security policy didn't allow it, with the message: Couldn't verify data signature: | |
| Untrusted Signing Chain Root: cert = '/CN=sferik/DC=gmail/DC=com', error = 'path "/Users/brad/.gem/trust/cert-f0d28c2182430599ebb06b92b03b7f32b98891e7.pem" does not exist' |
This file contains hidden or 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
| $ bundle install --trust-policy HighSecurity --path trusted_gems | |
| Fetching source index from https://rubygems.org/ | |
| Fetching https://github.com/meldium/casperjs.git | |
| remote: Counting objects: 9864, done. | |
| remote: Compressing objects: 100% (2569/2569), done. | |
| remote: Total 9864 (delta 7382), reused 9687 (delta 7241) | |
| Receiving objects: 100% (9864/9864), 3.25 MiB | 893 KiB/s, done. | |
| Resolving deltas: 100% (7382/7382), done. | |
| (...a bunch more gems get installed from GitHub) | |
| The gem rake-10.0.3 can't be installed because the security policy didn't allow it, with the message: Unsigned gem |
This file contains hidden or 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
| $ gem update bundler | |
| Updating installed gems | |
| Updating bundler | |
| Fetching: bundler-1.3.1.gem (100%) | |
| Successfully installed bundler-1.3.1 | |
| Gems updated: bundler | |
| $ bundle install --trust-policy HighSecurity | |
| Fetching source index from https://rubygems.org/ | |
| Using rake (10.0.3) |
This file contains hidden or 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 ExpensiveJob < Job | |
| def perform | |
| user = Service.find(options['id']).create_user | |
| write_result(user.account_id) | |
| end | |
| end | |
| # Usage | |
| job_id, cache_key = ExpensiveJob.create | |
| result = Rails.cache.read(cache_key) # Poll until non-nil |
This file contains hidden or 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):010:0> pp Array.new(10) { sleep 1; UUID.generate(:compact) } | |
| ["331028305ce70130d84d12313d05011b", | |
| "33aa4b005ce70130d84d12313d05011b", | |
| "344475605ce70130d84d12313d05011b", | |
| "34de8ea05ce70130d84d12313d05011b", | |
| "357898605ce70130d84d12313d05011b", | |
| "3612ba505ce70130d84d12313d05011b", | |
| "36acdc305ce70130d84d12313d05011b", | |
| "374713605ce70130d84d12313d05011b", | |
| "37e118605ce70130d84d12313d05011b", |
This file contains hidden or 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):004:0> require 'uuid' | |
| => true | |
| irb(main):005:0> UUID.generate(:compact) | |
| => "855ff3305ce60130d84d12313d05011b" |
This file contains hidden or 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 Resque::Plugins::Status::Hash | |
| def self.generate_uuid | |
| require 'uuid' unless defined?(UUID) | |
| UUID.generate(:compact) | |
| end | |
| end |
This file contains hidden or 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 ExpensiveJob | |
| include Resque::Plugins::Status | |
| def perform | |
| Service.find(options['id']).create_user | |
| end | |
| end |
This file contains hidden or 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
| #!/bin/sh | |
| open "https://www.meldium.com" |