Skip to content

Instantly share code, notes, and snippets.


James u007

View GitHub Profile
FranklinYu / README.markdown
Last active Dec 7, 2019
links for old versions of Docker for Mac (inspired by docker/for-mac#1120)
View README.markdown

links for old versions of Docker for Mac


Docker provides download links in release note. They promised that

(we) will also include download links in release notes for future releases.


thbar / go_build.rb
Last active Mar 4, 2017
Integration testing of a golang app with rspec and capybara-webkit.
View go_build.rb
module GoBuild
extend self
def build(file)
process ='go', 'build', file)
err ='stderr-spec') = err
njakobsen / live_database_dump.rb
Last active Oct 12, 2019
Live stream a database dump (or any other STDOUT) using Rails 4. Why would you want this? If you have a large database dump and want to avoid storing it in memory as Rails streams it. This allows pipe the dump directly into the http response instead of storing it as a file, sending it, and then deleting it. Let me know what you think! I've teste…
View live_database_dump.rb
class DatabaseController < ApplicationController
def database_dump
database = Rails.configuration.database_configuration[Rails.env]["database"]
send_file_headers!(:type => 'application/octet-stream', :filename => "#{database}_#{}.backup")
pipe = IO.popen("pg_dump '#{database}' -F c")
stream =
while (line = pipe.gets)
stream.write line
sleep 0.0001 # HACK: Prevent server instance from sleeping forever if client disconnects during download
You can’t perform that action at this time.