Skip to content

Instantly share code, notes, and snippets.

View carloslopes's full-sized avatar

Carlos Eduardo L. Lopes carloslopes

View GitHub Profile
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing">
<s:Header>
<a:Action s:mustUnderstand="1">http://www.w3.org/2005/08/addressing/soap/fault</a:Action>
</s:Header>
<s:Body>
<s:Fault>
<s:Code>
<s:Value>s:Sender</s:Value>
<s:Subcode>
<s:Value>a:DestinationUnreachable</s:Value>
@carloslopes
carloslopes / database_cleaner.rb
Last active August 29, 2015 13:56
DatabaseCleaner configuration
RSpec.configure do |config|
# If you're not using ActiveRecord, or you'd prefer not to run each of your
# examples within a transaction, remove the following line or assign false
# instead of true.
config.use_transactional_fixtures = false
config.before :suite do
DatabaseCleaner.clean_with :truncation
end
@carloslopes
carloslopes / gist:3296532
Created August 8, 2012 16:43
Handle Thread across routes in sinatra
require 'sinatra'
set :threads, []
get '/' do
settings.threads << Thread.new { sleep 10 }
'New thread created'
end
get '/threads' do
Failures:
1) RegistrationsController GET show content should have the personal informations
Failure/Error: expect(response.body).to have_selector('dd#email', :text => @user.email.html_safe)
expected css "dd#email" with text "<a href=\"mailto:email@example.com\">email@example.com</a>" to return something
@carloslopes
carloslopes / ajaxify-html5.js
Created August 28, 2012 14:36 — forked from balupton/README.md
Ajaxify a Website with the HTML5 History API using History.js, jQuery and ScrollTo
// https://gist.github.com/854622
(function(window,undefined){
// Prepare our Variables
var
History = window.History,
$ = window.jQuery,
document = window.document;
// Check to see if History.js is enabled for our Browser
@carloslopes
carloslopes / gist:3959987
Created October 26, 2012 17:08
capybara-webkit stacktrace
...................................................................................................................................................................................................Finished "EnableLogging" with response "Success()"
Wrote response true ""
Received "Visit"
Started "Visit"
Load started
"Visit" started page load
Started request to "http://127.0.0.1:53196/sign_in"
Finished "Visit" with response "Success()"
Started request to "http://127.0.0.1:53196/assets/application.css"
Started request to "http://127.0.0.1:53196/assets/application.js"
repo initialized in /Users/carloslopes/Projects/B2G
remote: Counting objects: 21614, done.
remote: Counting objects: 618498, done.
remote: Compressing objects: 100% (168650/168650), done.
remote: Compressing objects: 100% (7443/7443), done.
fatal: read error: Connection reset by peer82 MiB | 380 KiB/s
fatal: early EOF
fatal: index-pack failed
remote: Counting objects: 21614, done.
fatal: read error: Connection reset by peer3)
require 'sinatra/base'
module Sinatra
module FragmentCache
def fragment_cache(name, age, &block)
if cache = read_fragment(name, age)
@_out_buf << cache
else
pos = @_out_buf.length
tmp = block.call
Msg 208, Level 16, State 1, Procedure FN_CLUBE_VANTAGENS_CAMPANHA, Line 15
Invalid object name 'TB_CAMPANHA'.
Msg 213, Level 16, State 1, Procedure JP_INS_PONTUACAO_CONSOLIDADA_PONTUACAO, Line 11
Column name or number of supplied values does not match table definition.
Msg 7308, Level 16, State 1, Procedure JP_INSERE_PARTICIPANTE_EXCEL, Line 11
OLE DB provider 'Microsoft.Jet.OLEDB.4.0' cannot be used for distributed queries because the provider is configured to run in single-threaded apartment mode.
The module 'JP_APURACAO_INS_PREMIACAO_POL_2' depends on the missing object 'JP_APURACAO_INS_APROVACAO_NEGADO'. The module will still be created; however, it cannot run successfully until the object exists.
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near 'CONSTR'.
@carloslopes
carloslopes / gist:6698708
Created September 25, 2013 12:05
Threaded sinatra app
sinatra_thread = Thread.new do
require 'sinatra/base'
class SinatraServer < Sinatra::Base
get '/hi' do
"Hello World!"
end
run!
end