Skip to content

Instantly share code, notes, and snippets.

puts 'hello world'
@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")
@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 / 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 / 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)
class NilClass
def method_missing(method, *args)
<<~EOAA
Somebody once told me the world is gonna roll me
I ain't the sharpest tool in the shed
She was looking kind of dumb with her finger and her thumb
In the shape of an "L" on her forehead
Well, the years start coming and they don't stop coming
Fed to the rules and I hit the ground running
Didn't make sense not to live for fun
@Schwad
Schwad / destroyer.rb
Last active November 25, 2019 14:30
@apotonick Tesla Truck implementation
module Tesla
module Truck
module Destroyer
def self.call(human_name:)
puts "Das #{human_name} wurde zerstört."
end
end
end
end

Keybase proof

I hereby claim:

  • I am schwad on github.
  • I am schwad (https://keybase.io/schwad) on keybase.
  • I have a public key whose fingerprint is 3C9A 6DC1 2573 C25F BE23 22FF AB00 9D50 E34A E076

To claim this, I am signing this object:

@Schwad
Schwad / update-chrome-driver.sh
Last active February 6, 2019 14:56 — forked from fantactuka/update-chrome-driver.sh
Update Chrome driver for mac os to 2.46
#!/bin/bash
# bash < <(curl -s https://gist.githubusercontent.com/fantactuka/3228898/raw/f0806a64306426ca72f16734ae7cd16c1f84bd87/update-chrome-driver.sh)
echo "Updating Chrome Driver"
sudo su
if [ -e /usr/bin/chromedriver ]; then
rm /usr/bin/chromedriver
echo "Removing current Chrome Driver from /usr/bin"