I hereby claim:
- I am burlesona on github.
- I am burlesona (https://keybase.io/burlesona) on keybase.
- I have a public key whose fingerprint is 11DB FA34 1EF9 CF16 2955 D274 E038 68E9 30CF 7D68
To claim this, I am signing this object:
# 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) |
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'bundler/setup' | |
require_relative 'environment' | |
require 'models' | |
require 'helpers' | |
require 'pry' | |
Pry.start self |
#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; |
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| |
I hereby claim:
To claim this, I am signing this object:
# BEFORE RUBY 2.0 | |
def method(argument,hash) | |
end | |
method 1, :foo => "bar", :baz => "qux" | |
method 1, {:foo => "bar", :baz => "qux"} #identical | |
method(1, {:foo => "bar", :baz => "qux"}) #identical |
NameError: NameError: uninitialized constant WorkOrdersRouter::WorkOrdersView | |
/~/app/routers/work_orders_router.rb:11:in `block (2 levels) in <class:WorkOrdersRouter>' | |
/~/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/bundler/gems/sinatra-9929353e6c59/lib/sinatra/base.rb:1610:in `call' | |
/~/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/bundler/gems/sinatra-9929353e6c59/lib/sinatra/base.rb:1610:in `block in compile!' | |
/~/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/bundler/gems/sinatra-9929353e6c59/lib/sinatra/base.rb:974:in `[]' | |
/~/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/bundler/gems/sinatra-9929353e6c59/lib/sinatra/base.rb:974:in `block (3 levels) in route!' | |
/~/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/bundler/gems/sinatra-9929353e6c59/lib/sinatra/base.rb:993:in `route_eval' | |
/~/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/bundler/gems/sinatra-9929353e6c59/lib/sinatra/base.rb:974:in `block (2 levels) in route!' | |
/~/.rbenv/v |
foo = method def foo | |
def a(num) | |
3 * num.to_i | |
end | |
n = yield if block_given? | |
a(n || 3) | |
rescue | |
"oops!" | |
end |
class Hash | |
def to_date | |
Date.new fetch(:year), fetch(:month), fetch(:day) | |
end | |
end | |
class Date | |
def to_hash | |
{year: year, month: month, day: day} | |
end |
{ | |
"color_scheme": "Packages/Color Scheme - Default/SpecialsBoard.tmTheme", | |
"ensure_newline_at_eof_on_save": true, | |
"file_exclude_patterns": | |
[ | |
".DS_Store", | |
".tags*", | |
"*.pyc", | |
"*.pyo", | |
"*.exe", |