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
# Calling into cmd line (ShellScipt or PowerShell): | |
# ./clisoap-qualitor.rb config-file.yml | |
require 'savon' | |
require 'yaml' | |
config = YAML::load( File.open(ARGV[0]) ) | |
conn = Savon.client(wsdl:config["url"]) | |
auth = conn.call(:login, message:{login:config["login"], passwd:config["passwd"], company:config["company"]}) | |
# TIP: HOW TO KEEP SESSION WHEN CONSUMING A SOAPCLIENT WITH SAVON v.2 | |
# It's necessary to maintain the session with option: "cookies:auth.http.cookies" | |
r = conn.call(config["method"].to_sym, message: {auth:auth.body[:login_response][:result], xmlValue:config["xml"]}, cookies:auth.http.cookies) |
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
# into Nginx server | |
# how install: https://github.com/elastic/logstash-forwarder#building-it | |
# git clone git://github.com/elasticsearch/logstash-forwarder.git | |
# cd logstash-forwarder | |
# go build // it's necessary to install go interpreter | |
# vi forwarding.conf | |
# cmd to start service> ./logstash-forwarder -config forwarding.conf | |
#### ATTENTION when you generate the certificate | |
# the name on CN flag into comand openssl will be the same of servers configuration into file |
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
# encoding: UTF-8 | |
# Exercise description: http://goo.gl/2XsKhW | |
require 'minitest' | |
require "minitest/autorun" | |
############### Exercise 3 ############## | |
class Array | |
def combine_anagrams | |
self.group_by{|el| el.downcase.chars.sort}.values | |
end |
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
# encoding: UTF-8 | |
#http://watir.com/ | |
#https://github.com/watir/watir/ | |
require 'rubygems' | |
require "watir" | |
teste_site = "http://blogsearch.google.com.br/" | |
browser = Watir::IE.new | |
browser.goto teste_site |
h1. Meus comandos
for i in $(find -name '.');do file $i;done |grep UTF
#!/bin/bash for i in $(find -name '*.*');do iconv -f iso-8859-1 -t UTF-8 -o $i $i;done #do encoding=$(file -bi $i | sed -e 's/.*[ ]charset=//'); do iconv -f iso-8859-1 -t UTF-8 -o $i $i;done -----------------------------------------
Duas ótimas ferramentas e uma tarefa para testarmos as performances
###Nodejs nodejsapp https://nodejsapp-malha-logistica.herokuapp.com/
nodejs-source https://github.com/altherlex/nodejsapp-malha-logistica
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
# Testing Scaling | |
require 'benchmark' | |
n = 10000 | |
result = Benchmark.bm do |x| | |
x.report { for i in 1..n; Thread.new {`curl -XGET http://localhost:3000`}; end } | |
end |
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://stackoverflow.com/questions/9778657/why-does-this-simple-rspec-string-equality-spec-fail | |
describe First do | |
specify { First.new.to_s.should == "Hello World" } | |
end | |
describe First do | |
describe "#to_s" do | |
subject { First.new.to_s } | |
it { should == "Hello World" } | |
end |
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
//Automatic re-running with nodemon and npm server | |
nodemon -x 'npm start' | |
//or | |
node app.js | |
//Start mongodb | |
mongod --dbpath C:\mongodb\data\db |