Skip to content

Instantly share code, notes, and snippets.

View julesjans's full-sized avatar

Jules Jans julesjans

View GitHub Profile
@caendekerk
caendekerk / Gemfile
Created March 4, 2021 10:48
Rails API only with Okta but without Devise
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 6.0.0'
# Shorten boot time
gem 'bootsnap'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', github: 'rails/jbuilder'
@timm-oh
timm-oh / application_helper.rb
Last active December 17, 2023 21:04
Rails 5.2.3: Cache Active Storage Blobs and Variants through Cloudfront
# app/helpers/application_helper.rb
module ApplicationHelper
# active_storage_item could be a blob or variant object
def proxy_url(active_storage_item, options = {})
options.merge!(host: ENV['ASSETS_HOST']) if ENV['ASSETS_HOST'].present?
# proxy: 'true' allows you to stil have the original functionality while
# being able to proxy through a CDN. You've got to ensure that your CDN
# forwards this param otherwise active storage will always do the default
# behavior which is a redirect to the service.
@sinisterchipmunk
sinisterchipmunk / LICENSE
Last active September 8, 2023 17:57
tar, gzip, and untar files using ruby in memory without tempfiles
Copyright (C) 2011 by Colin MacKenzie IV
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in