Last active
August 29, 2015 14:02
-
-
Save naaman/9a0f6b7b7b89ffc1635a to your computer and use it in GitHub Desktop.
Revisions
-
naaman revised this gist
Jun 5, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -3,6 +3,6 @@ $ export STREAM_ID=$(curl busl.herokuapp.com/streams -X POST) $ ruby reader.rb $STREAM_ID # In a separate console $ ruby chunker.rb $STREAM_ID /path/to/file # watch all the hustle and bustle -
naaman renamed this gist
Jun 5, 2014 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
naaman created this gist
Jun 5, 2014 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ require 'excon' file = File.open(ARGV[1], 'rb') streamer = lambda do file.read(Excon.defaults[:chunk_size]).to_s end res = Excon.post( "http://busl.herokuapp.com/streams/#{ARGV[0]}", headers: { CONTENT_TYPE: 'application/octet-stream' }, request_block: streamer ) puts res.inspect file.close 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ require 'excon' streamer = lambda do |chunk, remaining_bytes, total_bytes| puts chunk end res = Excon.get( "http://busl.herokuapp.com/streams/#{ARGV[0]}", response_block: streamer ) puts res.inspect 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,8 @@ $ export STREAM_ID=$(curl busl.herokuapp.com/streams -X POST) $ ruby reader.rb $STREAM_ID # In a separate console $ ruby chunker.rb b7e586c8404b74e1805f5a9543bc516f /path/to/file # watch all the hustle and bustle