Skip to content

Instantly share code, notes, and snippets.

View rodrigogmdias's full-sized avatar
🏠
Working from home

Rodrigo Gomes Dias rodrigogmdias

🏠
Working from home
View GitHub Profile
@NataliaAvila
NataliaAvila / Rails
Last active June 7, 2016 13:55
Resolvendo problema de SSL em Windows (Rails) - Faraday::Error::ConnectionFailed SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
#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
@pachacamac
pachacamac / google_speech_recognition.rb
Created December 11, 2011 10:52
google speech recognition with ruby
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
@travis
travis / gist:1084767
Created July 15, 2011 14:16
testing facebook connect with capybara and rspec
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)
@dcrec1
dcrec1 / seeds.rb
Created April 29, 2010 15:07
State of Brazil for Spree
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