This file contains 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
/* http://redd.it/2z68di */ | |
#define _BSD_SOURCE // MAP_ANONYMOUS | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
#include <string.h> | |
#include <sys/mman.h> | |
#define PAGE_SIZE 5000 |
This file contains 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 'net/http' | |
require 'uri' | |
def download(url) | |
Thread.new do | |
thread = Thread.current | |
body = thread[:body] = [] | |
url = URI.parse url | |
Net::HTTP.new(url.host, url.port).request_get(url.path) do |response| |