Today, in Ruby, if I want to make a network request, I block
response = Net::HTTP.get("/post/1")
If I want to do multiple requests in parallel, I can use a thread per request
responses = ["/post/1", "/post/2"].map do |url|
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
Today, in Ruby, if I want to make a network request, I block
response = Net::HTTP.get("/post/1")
If I want to do multiple requests in parallel, I can use a thread per request
responses = ["/post/1", "/post/2"].map do |url|
--- | |
- :cod_uf: '52' | |
:uf: Goiás | |
:city_id: '00050' | |
:city: Abadia de Goiás | |
:sigla_uf: GO | |
:city_code: '5200050' | |
- :cod_uf: '31' | |
:uf: Minas Gerais | |
:city_id: '00104' |
default: &default | |
adapter: postgresql | |
encoding: unicode | |
pool: 5 | |
username: root | |
password: | |
host: localhost | |
development: | |
<<: *default |
# This is a skeleton for testing models including examples of validations, callbacks, | |
# scopes, instance & class methods, associations, and more. | |
# Pick and choose what you want, as all models don't NEED to be tested at this depth. | |
# | |
# I'm always eager to hear new tips & suggestions as I'm still new to testing, | |
# so if you have any, please share! | |
# | |
# @kyletcarlson | |
# | |
# This skeleton also assumes you're using the following gems: |
require 'openssl' | |
def gen_key(name) | |
key = OpenSSL::PKey::RSA.new 1048 | |
file = File.new(name, "w") | |
file.write(key) | |
file.close | |
end | |
def get_key(name) |
require "active_record" | |
namespace :db do | |
db_config = YAML::load(File.open('config/database.yml')) | |
db_config_admin = db_config.merge({'database' => 'postgres', 'schema_search_path' => 'public'}) | |
desc "Create the database" | |
task :create do | |
ActiveRecord::Base.establish_connection(db_config_admin) |
https://devcenter.heroku.com/articles/custom-domains http://thenomadicfreelancer.blogspot.com/2012/08/pointing-godaddy-domain-to-your-heroku.html
For each custom subdomain use domains:add
in the Terminal.
#!/bin/bash | |
# | |
# DROPKICK.SH | |
# | |
# Detect and Disconnect the DropCam and Withings devices some people are using to | |
# spy on guests in their home, especially in AirBnB rentals. Based on Glasshole.sh: | |
# | |
# http://julianoliver.com/output/log_2014-05-30_20-52 | |
# | |
# This script was named by Adam Harvey (http://ahprojects.com), who also |