Skip to content

Instantly share code, notes, and snippets.

@Schwad
Schwad / Result
Created August 21, 2021 14:41 — forked from chuyeow/Result
$ ./hpricot_vs_nokogiri.rb
user system total real
hpricot:doc 0.230000 0.010000 0.240000 ( 0.265904)
nokogiri:doc 0.030000 0.010000 0.040000 ( 0.041641)
user system total real
hpricot:xpath 1.050000 0.020000 1.070000 ( 1.114454)
nokogiri:xpath 0.210000 0.010000 0.220000 ( 0.226418)
user system total real
hpricot:css 1.140000 0.030000 1.170000 ( 1.339635)
nokogiri:css 0.700000 0.010000 0.710000 ( 0.835559)
@Schwad
Schwad / deploy-static-site-heroku.md
Created September 24, 2021 16:53 — forked from wh1tney/deploy-static-site-heroku.md
How to deploy a static website to Heroku

Gist

This is a quick tutorial explaining how to get a static website hosted on Heroku.

Why do this?

Heroku hosts apps on the internet, not static websites. To get it to run your static portfolio, personal blog, etc., you need to trick Heroku into thinking your website is a PHP app. This 6-step tutorial will teach you how.

Basic Assumptions

@Schwad
Schwad / Comment
Created August 18, 2022 11:51 — forked from glaville/Comment
With the last fixes, scaffold_extensions work for this example, but override layout of the other Ramaze::Controller in the same Ramaze::App
- /foo should use /layout/foo.xhtml as layout, and be renderer an a gray background
- /f/forum should use /layout/foo.xhtml as well
The problem seems to be linked to the fact the Ramaze adapter now updates the *existing containing Ramaze::App* with its own path (here, default one and :forum) and affect as such any other controller in theses Apps.
@Schwad
Schwad / gems.rb
Created September 7, 2022 09:45 — forked from kddnewton/gems.rb
Extract the latest versions of each Ruby gem on your system
# frozen_string_literal: true
require "rubygems/package"
require "net/http"
require "tmpdir"
queue = Queue.new
Gem::SpecFetcher.new.available_specs(:latest).first.each do |source, gems|
gems.each do |tuple|
gem_name = File.basename(tuple.spec_name, ".gemspec")
puts 'hello world'