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 'resolv' | |
filename = ARGV[0] | |
batch_size = ARGV[1].to_i | |
outfile = File.open('ip-addresses.txt','w+') | |
domains = File.readlines(filename) | |
groups = domains.each_slice(batch_size) | |
threads = [] | |
results = [] | |
groups.each_with_index do |group,index| |
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
#user nobody; | |
worker_processes 1; | |
#error_log logs/error.log; | |
#error_log logs/error.log notice; | |
#error_log logs/error.log info; | |
#pid logs/nginx.pid; |
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 'bundler/setup' | |
require_relative 'environment' | |
require 'models' | |
require 'helpers' | |
require 'pry' | |
Pry.start self |
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
# Not that this is an impressive demo, but it makes the point that Ruby | |
# does in fact have the ability to create "pure" functions and pass them | |
# as arguments to higher order functions. People get hung up on the syntax | |
# but it's not really that complicated. | |
make_adder = method def make_adder(num) | |
->(input){ input + num } | |
end | |
make_add_twice = method def make_add_twice(adder, num) |
OlderNewer