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
| ### Keybase proof | |
| I hereby claim: | |
| * I am mru2 on github. | |
| * I am mru2 (https://keybase.io/mru2) on keybase. | |
| * I have a public key ASD3Ty-eaUw6HF7D1I3BHFuPjAw5ibLcu4wwUmUPjZ3zWAo | |
| To claim this, I am signing this object: |
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
| # Create and download backup | |
| heroku pg:backups:capture | |
| heroku pg:backups:download | |
| # Assumes the database container is named 'db' | |
| DOCKER_DB_NAME="$(docker-compose ps -q db)" | |
| DB_HOSTNAME=db | |
| DB_USER=postgres | |
| LOCAL_DUMP_PATH="path/to/local.dump" |
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
| # string => unique | |
| def transaction_id(reference) | |
| "#{Time.now.to_i}#{Random.rand(1000)}|#{reference}" | |
| end | |
| # unique => string | |
| def reference(transaction_id) | |
| transaction_id.match(/\d+|(.*)/)[1] | |
| 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
| # ============= | |
| # Without proxy | |
| # ============= | |
| require 'soap_client' | |
| class Webservice | |
| def initialize() | |
| @client = SoapClient.new('http://my.api.com/endpoint') |
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
| def show | |
| rack_response = Rack::Response.new(["Hello!"], 200, {'Content-Type' => 'test/plain'}) | |
| self.response = ActionDispatch::Response.new(*rack_response.to_a) | |
| self.response.close | |
| return | |
| 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
| require 'rspec' | |
| ####### | |
| # SPECS | |
| ####### | |
| describe "blob projection" do |
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
| #!/usr/bin/env ruby | |
| require 'rubygems' | |
| require 'anemone' | |
| require 'colorize' | |
| entry = ARGV[0] | |
| unless entry | |
| puts "Please precise a point to start the crawl" |