#Instalando elasticsearch 0.90.3 com o Homebrew
####1. Unload e Unlink da versão atual
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.elasticsearch.plist
brew unlink elasticsearch
####2. Vai para o repositório do Homebrew
sudo env PATH=$PATH foreman export upstart /etc/init -f Procfile-name -a app-name -u deployer | |
#https://github.com/sstephenson/rbenv/issues/127 |
#!/bin/bash | |
VERSION="0.90.1" | |
PORT="9200" | |
PWD=`pwd` | |
mkdir -p ~/elasticsearch/ | |
cd ~/elasticsearch/ | |
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-${VERSION}.zip |
https://thrift.apache.org/ | |
https://avro.apache.org/ | |
https://github.com/google/protobuf | |
http://msgpack.org/ | |
https://capnproto.org/ |
#Instalando elasticsearch 0.90.3 com o Homebrew
####1. Unload e Unlink da versão atual
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.elasticsearch.plist
brew unlink elasticsearch
####2. Vai para o repositório do Homebrew
gem install puma -- --with-cppflags=-I/usr/local/opt/openssl/include --with-ldflags=-L/usr/local/opt/openssl/lib | |
#http://stackoverflow.com/a/32061171/8581 |
def validate_item_exist?(products, item) | |
!products[item].nil? | |
end | |
def validate_item_stock?(products, item, quant) | |
stock = products[item].first | |
return stock >= quant | |
end | |
def add_item_cart(carrinho, item, quant) |
require "date" | |
def sex(cod) | |
if cod.to_i == 1 | |
return "it's a man" | |
else | |
return "it's a woman" | |
end | |
end |
require 'csv' | |
file = 'data/alunos.csv' | |
options = {headers: true, col_sep: ',', encoding: 'utf-8', force_quotes: true} | |
CSV.open(file, 'w', options) do |csv| | |
csv << ['Nome', 'Email', 'Hobby'] | |
csv << ['Roger,', 'rogerpscott@gmail','coding'] | |
csv << ['Lincoln', 'antoniolincoln@live.com','eletrônica'] |
require_relative 'cookbook' # You need to create this file! | |
require_relative 'controller' # You need to create this file! | |
require_relative 'router' | |
require 'pry' | |
csv_file = File.join(__dir__, 'recipes.csv') | |
cookbook = Cookbook.new(csv_file) | |
controller = Controller.new(cookbook) | |
router = Router.new(controller) |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>--- TODO ---</title> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> |