Skip to content

Instantly share code, notes, and snippets.

View jean-francois-labbe's full-sized avatar
🏠
Working remotly

Jean-Francois Labbé jean-francois-labbe

🏠
Working remotly
View GitHub Profile
@julianrubisch
julianrubisch / convert_to_webp.rb
Last active April 26, 2024 08:27
Ruby Oneliners to convert images to webp and generate thumbnails
require 'fileutils'
# Loop through all .jpg and .png files in the current directory
Dir.glob("{*.jpg,*.png}").each do |img|
# Construct the output filename with .webp extension
output_filename = "#{File.basename(img, File.extname(img))}.webp"
# Execute ffmpeg command to convert the image
system("ffmpeg -i '#{img}' '#{output_filename}'")
end
@dhh
dhh / Gemfile
Created June 24, 2020 22:23
HEY's Gemfile
ruby '2.7.1'
gem 'rails', github: 'rails/rails'
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data
# Action Text
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra'
gem 'okra', github: 'basecamp/okra'
# Drivers
@kevcha
kevcha / namespace_partials_sharing.md
Last active December 29, 2022 07:53
How to automatically share partials between namespaces in rails

When writing a rails app, we often have to deal with multiple namespaces. The most common case is having classic actions and some others in an admin namespace. Some actions may have same views between namespaces.

For exemple, you could have a ProjectsController with an action index :

class ProjectsController < ApplicationController
  def index
    # do something
  end
end