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
#Problema com SSL no Rails | |
- Fazer download do arquivo e salvar no Desktop | |
https://gist.github.com/fnichol/867550/raw/win_fetch_cacerts.rb | |
- Abra o Prompt e digite cole codigo abaixo | |
ruby "%USERPROFILE%\Desktop\win_fetch_cacerts.rb" | |
- Acesse Variaveis de Ambiente que fica no painel de controle/avançado e clique em novo e insira as informações abaixo e clique em ok apos terminar | |
Variavel: SSL_CERT_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
require 'rest_client' | |
require 'json' | |
a = `sox -d --norm -t .flac - silence -l 1 0 1% 1 6.0 1% rate 16k` | |
#a = `arecord -q -d 3 -c 1 -f S16_LE -r 22050 -t wav | flac - -f --totally-silent -o-` | |
r = RestClient.post 'https://www.google.com/speech-api/v1/recognize?lang=en-US', a, | |
:content_type => 'audio/x-flac; rate=16000' | |
if j = JSON.parse(r) | |
(p j; `espeak 'you said: #{j['hypotheses'].first['utterance']}'`) | |
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
require 'mogli' | |
module FacebookIntegrationHelpers | |
shared_context "with unconnected facebook user" do | |
let(:fb_user) { create_test_user(installed: false) } | |
after { fb_user.destroy } | |
end | |
def app_client | |
Mogli::AppClient.new(AppConfig.facebook.access_token, AppConfig.facebook.app_id) |
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
states = <<STATES | |
28,AC,Acre | |
28,AL,Alagoas | |
28,AP,Amapá | |
28,AM,Amazonas | |
28,BA,Bahia | |
28,CE,Ceará | |
28,ES,Espírito Santo | |
28,GO,Goiás | |
28,MA,Maranhão |