Skip to content

Instantly share code, notes, and snippets.

View barbolo's full-sized avatar

Rafael Barbolo barbolo

View GitHub Profile
@barbolo
barbolo / bootstrap.diff
Last active July 20, 2023 17:47
Playwright patches for firefox 105.0.2 - BASE_REVISION=e0ccf0a049acc6e0911465c9679d9cae1e026ba2
diff --git a/accessible/base/NotificationController.h b/accessible/base/NotificationController.h
index bc1a692c23d8599512a5ce956d99998640347c46..4e77897aa4a84ce88445ba45f1ba3b5b2dde9e23 100644
--- a/accessible/base/NotificationController.h
+++ b/accessible/base/NotificationController.h
@@ -244,6 +244,8 @@ class NotificationController final : public EventQueue,
}
#endif
+ bool IsUpdatePendingForJugglerAccessibility() { return IsUpdatePending(); }
+
@barbolo
barbolo / render_post_with_libxml.rb
Created July 18, 2018 18:07
Render a post with libxml in Ruby
class Renderer::Post
def self.create_doc_xml(root)
doc = LibXML::XML::Document.new
doc.encoding = LibXML::XML::Encoding::UTF_8
doc.root = LibXML::XML::Node.new(root)
doc
end
def self.create_node(name, value=nil, type=nil)
node = LibXML::XML::Node.new(name)
@barbolo
barbolo / benchmark_xml_render.rb
Created July 18, 2018 16:52
This is a comprehensive XML generation benchmark with some of the most popular Ruby gems
# gem install benchmark-memory activesupport builder nokogiri rabl ox libxml-ruby
require 'benchmark'
require 'benchmark-memory'
require 'builder'
require 'active_support/core_ext/hash/conversions'
require 'rabl'
require 'nokogiri'
require 'libxml'
require 'ox'
@barbolo
barbolo / benchamark_hash_to_json.rb
Last active September 24, 2022 03:32
Benchmark of JSON rendering in Ruby
# gem install multi_json json yajl-ruby oj benchmark-memory
require 'multi_json'
require 'json'
require 'yajl'
require 'oj'
require 'benchmark'
require 'benchmark-memory'
hash1 = {
@barbolo
barbolo / estagio-programacao-preparacao-exercicios.md
Last active April 13, 2020 18:45
[Estágio em Programação] Preparação para os exercícios
@barbolo
barbolo / pdf_to_xml.rb
Last active January 16, 2023 04:05
Convert PDF to XML in Ruby using poppler-utils
# Install dependencies:
#
# posix-spawn (check all benefits at https://github.com/rtomayko/posix-spawn)
# gem install posix-spawn
#
# Poppler utils (http://poppler.freedesktop.org/)
# apt-get install poppler-utils
#
require 'posix/spawn'