Instantly share code, notes, and snippets.

Wellington Torrejais da Silva wellington1993

View GitHub Profile
View xls_spec.rb
#encoding: utf-8
require 'spreadsheet'
xls_file_name = "/tmp/status_data.xls"
xls_book = Spreadsheet.open(xls_file_name, "rb")
xls_book.worksheet(0).each do |row|
puts row[6].value if row[6] and row[6].is_a?(Spreadsheet::Formula)
View Exemplo-Google-analytics.html
<!-- Google Analytics -->
<script>
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
ga('create', 'UA-130007306-1', 'auto');
ga('send', 'pageview');
</script>
<script async="async" crossorigin="anonymous" src="/javascripts/analytics.js?1533932182" type="text/javascript"></script>
<!-- End Google Analytics -->
View dispatcher.rb.patch
--- a/rails-1.2.6/lib/dispatcher.rb
+++ b/rails-1.2.6/lib/dispatcher.rb
@@ -41,7 +41,7 @@
controller.process(request, response).out(output)
end
rescue Exception => exception # errors from CGI dispatch
- failsafe_response(output, '500 Internal Server Error', exception) do
+ failsafe_response(output, '500 Internal Server Error', exception, response) do
controller ||= (ApplicationController rescue ActionController::Base)
controller.process_with_exception(request, response, exception).out(output)
View FOUC-fix.md

Fix for FOUC :

At the top of your HTML:

<!doctype html>
<html>
<head>
    <style>html{visibility: hidden;opacity:0;}</style>
View exemplo-api-cep.json
{"logradouro":"Rua Guaratuba","bairro":"Residencial Atlântico III","cidade":"Cianorte","uf":"PR"}
View 0-Teste-Copel-Instável-Hotsoft-2018-11-16.txt
Upload-problem.txt
http://www.speedtest.net/result/7805438432
https://www.speedtest.net/result/7805326734
https://www.speedtest.net/result/7805356503
http://www.speedtest.net/result/7805392206
View Testes-Rede-Copel-GVT-2018-11-14-Instavel-MTR.txt
3p.ampproject.net.txt
My traceroute [v0.92]
wellington-Inspiron-3647 (192.168.200.45) 2018-11-14T18:05:38-0200
Keys: Help Display mode Restart statistics Order of fields quit
Packets Pings
Host Loss% Snt Last Avg Best Wrst StDev
1. 192.168.1.1 98.7% 1028 9088. 4766. 0.5 9088. 3826.
gvt-b-sr02.mga.gvt.net.br
2. 100.127.252.71 61.8% 1028 9.4 169.1 8.4 9223. 1094.
View Bundle-update-old-redmine.txt
repo:/home/vhosts/redmine # bundle install
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all
non-root users on this machine.
Warning: this Gemfile contains multiple primary sources. Using `source` more than once without a block is a security risk, and may result in installing unexpected gems. To resolve this warning, use a block to indicate which gems should come from the secondary source. To upgrade this warning to an error, run `bundle config disable_multisource true`.
Your Gemfile lists the gem yard (>= 0) more than once.
You should probably keep only one of them.
While it's not a problem now, it could cause errors if you change the version of just one of them later.
Warning: this Gemfile contains multiple primary sources. Using `source` more than once without a block is a security risk, and may result in installing unexpected gems. To resolve this warning, use a block to indicate which gems should come from the secon
View Reset-network-Windows.bat
@echo on
rem https://www.hanselman.com/blog/TheNuclearOptionResettingTheCrapOutOfYourNetworkAdaptersInVista.aspx
rem https://www.geeksinphoenix.com/blog/post/2015/06/16/how-to-reset-your-network-adapter-in-windows-10.aspx
rem Reset everything
View gist:10cd0d657e66c1623c98e8ee699e912d
uses
WinSpool;
procedure TFrmMain.btnImprimir(Sender: TObject);
var
Handle: THandle;
CaracteresImpressos: DWORD;
Documento: TDocInfo1;
TextoAnsiString : AnsiString;
TextoUnicode: string;